]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: do not fail if kernel does not support alternative names
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Dec 2019 06:32:22 +0000 (15:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Dec 2019 06:43:50 +0000 (15:43 +0900)
man/systemd.link.xml
src/udev/net/link-config.c

index 0f9e988ba04b18d13f1303379b039c473889de5e..be8dda0bac0bca25b085ce4dce64038ed05ab5bb 100644 (file)
         <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>
index a51703b8b7fae6815b4675c94074ff5ff649fa53..ca11cfd9e381ffe5b234a158aa149c1935b01e3a 100644 (file)
@@ -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;