1 Star 0 Fork 98

Mingtai/systemd_1

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-network-address-read-flags-from-message-header-when-.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
From a6c264cbd6fc8c10c905ee2c1cd22717247c3c25 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Wed, 8 Dec 2021 05:35:37 +0900
Subject: [PATCH] network: address: read flags from message header when
IFA_FLAGS is not supported by kernel
Follow-up for 0828a38605975b68c14c9194a1ee2c5c2ff7038f.
Fixes #21670.
(cherry picked from commit 8ed68422e1bafc84afe524bc5020d343bc6163ca)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/a6c264cbd6fc8c10c905ee2c1cd22717247c3c25
---
src/network/networkd-address.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 7b221516d7..bfc2e19bee 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -1368,6 +1368,14 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message,
}
r = sd_netlink_message_read_u32(message, IFA_FLAGS, &tmp->flags);
+ if (r == -ENODATA) {
+ unsigned char flags;
+
+ /* For old kernels. */
+ r = sd_rtnl_message_addr_get_flags(message, &flags);
+ if (r >= 0)
+ tmp->flags = flags;
+ }
if (r < 0) {
log_link_warning_errno(link, r, "rtnl: received address message without flags, ignoring: %m");
return 0;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd_1.git
git@gitee.com:yangmingtaip/systemd_1.git
yangmingtaip
systemd_1
systemd_1
master

搜索帮助