diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-25 03:09:19 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-27 00:03:39 +0200 |
commit | 7606377e2ce156681fb6c51a117846d61c650e9e (patch) | |
tree | a3086079a26caa0bca3488a24f2e5698640ea217 | |
parent | test: check sd_device_get_ifindex() returns positive ifindex when it succeeds (diff) | |
download | systemd-7606377e2ce156681fb6c51a117846d61c650e9e.tar.xz systemd-7606377e2ce156681fb6c51a117846d61c650e9e.zip |
network,udev: drop unnecessary check whether ifindex is positive
As sd_device_get_ifindex() now returns positive ifindex when it
succeeds.
-rw-r--r-- | src/network/networkd-manager.c | 4 | ||||
-rw-r--r-- | src/udev/net/link-config.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 4a621950ca..f7e9b48609 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -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; } diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 2d25f75357..c39d8791f2 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -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; |