As sd_device_get_ifindex() now returns positive ifindex when it
succeeds.
return 0;
r = sd_device_get_ifindex(device, &ifindex);
- if (r < 0 || ifindex <= 0) {
- log_debug("Ignoring udev ADD event for device with invalid ifindex");
+ if (r < 0) {
+ log_debug_errno(r, "Ignoring udev ADD event for device without ifindex or with invalid ifindex: %m");
return 0;
}
r = sd_device_get_ifindex(device, &ifindex);
if (r < 0)
return log_device_warning_errno(device, r, "Could not find ifindex: %m");
- if (ifindex <= 0)
- return log_device_warning_errno(device, EINVAL, "Invalid ifindex '%d'", ifindex);
if (ctx->enable_name_policy && config->name_policy) {
NamePolicy *policy;