From: Yu Watanabe Date: Tue, 17 Dec 2019 06:32:22 +0000 (+0900) Subject: udev: do not fail if kernel does not support alternative names X-Git-Tag: v245-rc1~251^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb181dd4a664ca8e82a8f7194261fd6531e861d8;p=thirdparty%2Fsystemd.git udev: do not fail if kernel does not support alternative names --- diff --git a/man/systemd.link.xml b/man/systemd.link.xml index 0f9e988ba04..be8dda0bac0 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -361,7 +361,8 @@ 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. + have no effect. If the kernel does not support the alternative names, then this setting will + be ignored. diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index a51703b8b7f..ca11cfd9e38 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -462,7 +462,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;