]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 May 2023 02:46:11 +0000 (11:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 May 2023 07:37:31 +0000 (16:37 +0900)
src/udev/net/link-config.c

index 4c83eede7aac2566070897b3def1a37680763430..e5f1220928cfdae6febaa0291f4f5348f15aedb2 100644 (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();