]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin-net_id: reading phys_port_name may be refused with EOPNOTSUPP
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Oct 2022 06:29:25 +0000 (15:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Oct 2022 11:29:41 +0000 (20:29 +0900)
If reading the sysattr failed with such error, the whole operation in
net_id builtin command will fail, and the interface will not be renamed.

Fixes a bug introduced by 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.

src/udev/udev-builtin-net_id.c

index 28ff32496a6b92a616ef3b62c3f80b23eab1fb48..13ef700b1ea6de71d40108b2bf805274ec70a064 100644 (file)
@@ -1082,9 +1082,7 @@ static int get_link_info(sd_device *dev, LinkInfo *info) {
         if (r < 0 && r != -ENOENT)
                 return r;
 
-        r = sd_device_get_sysattr_value(dev, "phys_port_name", &info->phys_port_name);
-        if (r < 0 && r != -ENOENT)
-                return r;
+        (void) sd_device_get_sysattr_value(dev, "phys_port_name", &info->phys_port_name);
 
         r = sd_device_get_sysattr_value(dev, "address", &s);
         if (r < 0 && r != -ENOENT)