1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00

Merge pull request #21435 from yuwata/network-cleanups-for-alternative-names

network: cleanups for alternative names
This commit is contained in:
Yu Watanabe 2021-11-19 12:05:04 +09:00 committed by GitHub
commit cc0f820960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2231,9 +2231,16 @@ static int link_update_alternative_names(Link *link, sd_netlink_message *message
assert(message);
r = sd_netlink_message_read_strv(message, IFLA_PROP_LIST, IFLA_ALT_IFNAME, &altnames);
if (r < 0 && r != -ENODATA)
if (r == -ENODATA)
/* The message does not have IFLA_PROP_LIST container attribute. It does not means the
* interface has no alternative name. */
return 0;
if (r < 0)
return log_link_debug_errno(link, r, "rtnl: failed to read alternative names: %m");
if (strv_equal(altnames, link->alternative_names))
return 0;
STRV_FOREACH(n, link->alternative_names)
hashmap_remove(link->manager->links_by_name, *n);