network,udev: drop unnecessary check whether ifindex is positive
As sd_device_get_ifindex() now returns positive ifindex when it succeeds.
This commit is contained in:
parent
5d062b4ef0
commit
7606377e2c
|
@ -197,8 +197,8 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -412,8 +412,6 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue