1 Star 0 Fork 50

Zhao Hang/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0715-udev-do-not-fail-if-kernel-does-not-support-alternat.patch 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:44 . update to systemd-239-58.el8.src.rpm
From f0b11f5042489c85d5016eceff06647bb49d486a Mon Sep 17 00:00:00 2001
From: Yu Watanabe <[email protected]>
Date: Tue, 17 Dec 2019 15:32:22 +0900
Subject: [PATCH] udev: do not fail if kernel does not support alternative
names
(cherry picked from commit bb181dd4a664ca8e82a8f7194261fd6531e861d8)
Related: #2005008
---
man/systemd.link.xml | 3 ++-
src/udev/net/link-config.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/man/systemd.link.xml b/man/systemd.link.xml
index 0b0d83349d..c8ebb751ee 100644
--- a/man/systemd.link.xml
+++ b/man/systemd.link.xml
@@ -348,7 +348,8 @@
<listitem>
<para>The alternative interface name to use. This option can be specified multiple times.
If the empty string is assigned to this option, the list is reset, and all prior assignments
- have no effect.</para>
+ have no effect. If the kernel does not support the alternative names, then this setting will
+ be ignored.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 4de8ee7d7e..8e88c8e5c4 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -474,7 +474,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
return log_warning_errno(r, "Could not set Alias=, MACAddress= or MTU= on %s: %m", old_name);
r = rtnl_set_link_alternative_names(&ctx->rtnl, ifindex, config->alternative_names);
- if (r < 0)
+ if (r == -EOPNOTSUPP)
+ log_debug_errno(r, "Could not set AlternativeName= on %s, ignoring: %m", old_name);
+ else if (r < 0)
return log_warning_errno(r, "Could not set AlternativeName= on %s: %m", old_name);
*name = new_name;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhaohang_mskdxl/systemd.git
[email protected]:zhaohang_mskdxl/systemd.git
zhaohang_mskdxl
systemd
systemd
a8

搜索帮助