udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name

This commit is contained in:
Yu Watanabe
2023-05-16 11:46:11 +09:00
parent 5668f3a7cf
commit e65c6c1baa

View File

@@ -836,7 +836,7 @@ static int link_apply_alternative_names(Link *link, sd_netlink **rtnl) {
default:
assert_not_reached();
}
if (!isempty(n)) {
if (ifname_valid_full(n, IFNAME_VALID_ALTERNATIVE)) {
r = strv_extend(&altnames, n);
if (r < 0)
return log_oom();