1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-10 00:58:20 +03:00

udev: do not fail if kernel does not support alternative names

This commit is contained in:
Yu Watanabe 2019-12-17 15:32:22 +09:00
parent 78f8849f84
commit bb181dd4a6
2 changed files with 5 additions and 2 deletions

View File

@ -361,7 +361,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>

View 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;