From: Yu Watanabe Date: Sun, 11 Nov 2018 14:33:17 +0000 (+0900) Subject: libudev: conserve previous behavior X-Git-Tag: v240~353^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ecbc4b880b91e997babc924fccb7cbebb8b0943;p=thirdparty%2Fsystemd.git libudev: conserve previous behavior The commit dcfbde3a43d632ff6e286c77e1081087eca59d8e changes sd_device_get_ifindex() returns -ENOENT instead of zero if the device does not have ifindex. Let's keep the original behavior of udev_device_get_ifindex(). Fixes #10699. --- diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index a7868a11cb2..70b00c1498a 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -52,6 +52,8 @@ int udev_device_get_ifindex(struct udev_device *udev_device) { assert(udev_device); r = sd_device_get_ifindex(udev_device->device, &ifindex); + if (r == -ENOENT) + return 0; if (r < 0) return r;