Fetch the repository succeeded.
This action will force synchronization from src-openEuler/systemd, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
From 6ee3390c978dca7a590a4c16d4d620984e60fa96 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 10 Sep 2021 08:09:56 +0900
Subject: [PATCH] network: fix handling of network interface renaming
Fixes #20657.
(cherry picked from commit 160203e974945ce520fe8f569458634ef898c61c)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/6ee3390c978dca7a590a4c16d4d620984e60fa96
---
src/network/networkd-link.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d58b700050..20675f2306 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1404,17 +1404,21 @@ static int link_initialized(Link *link, sd_device *device) {
assert(link);
assert(device);
- if (link->state != LINK_STATE_PENDING)
- return 0;
+ /* Always replace with the new sd_device object. As the sysname (and possibly other properties
+ * or sysattrs) may be outdated. */
+ sd_device_ref(device);
+ sd_device_unref(link->sd_device);
+ link->sd_device = device;
- if (link->sd_device)
+ /* Do not ignore unamanaged state case here. If an interface is renamed after being once
+ * configured, and the corresponding .network file has Name= in [Match] section, then the
+ * interface may be already in unmanaged state. See #20657. */
+ if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_UNMANAGED))
return 0;
log_link_debug(link, "udev initialized link");
link_set_state(link, LINK_STATE_INITIALIZED);
- link->sd_device = sd_device_ref(device);
-
/* udev has initialized the link, but we don't know if we have yet
* processed the NEWLINK messages with the latest state. Do a GETLINK,
* when it returns we know that the pending NEWLINKs have already been
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。