]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libudev: conserve previous behavior
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 11 Nov 2018 14:33:17 +0000 (23:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 12 Nov 2018 04:00:30 +0000 (13:00 +0900)
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.

src/libudev/libudev-device-private.c

index a7868a11cb20ae1543c49ca64e35297d746efd8f..70b00c1498a82613561afaa3626ea81c7347be2c 100644 (file)
@@ -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;