From: Yu Watanabe Date: Tue, 4 Oct 2022 06:29:25 +0000 (+0900) Subject: udev-builtin-net_id: reading phys_port_name may be refused with EOPNOTSUPP X-Git-Tag: v252-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6766c538a9f5c25f24d7f55219311dd284b6681;p=thirdparty%2Fsystemd.git udev-builtin-net_id: reading phys_port_name may be refused with EOPNOTSUPP 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. --- diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 28ff32496a6..13ef700b1ea 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -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)