diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 276aad0989..7ddc58337b 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1403,7 +1403,7 @@ void address_cancel_request(Address *address) { int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message, Manager *m) { _cleanup_(address_freep) Address *tmp = NULL; struct ifa_cacheinfo cinfo; - Link *link = NULL; + Link *link; uint16_t type; Address *address = NULL; int ifindex, r; @@ -1439,7 +1439,7 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message, } r = link_get_by_index(m, ifindex, &link); - if (r < 0 || !link) { + if (r < 0) { /* when enumerating we might be out of sync, but we will get the address again, so just * ignore it */ if (!m->enumerating) diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index e3c332eadb..05ad0738e6 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -490,7 +490,7 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, } r = link_get_by_index(m, ifindex, &link); - if (r < 0 || !link) { + if (r < 0) { /* when enumerating we might be out of sync, but we will get the neighbor again. Also, * kernel sends messages about neighbors after a link is removed. So, just ignore it. */ log_debug("rtnl: received neighbor for link '%d' we don't know about, ignoring.", ifindex); diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index eed28440c2..3eda1f1b7d 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -835,7 +835,7 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, } r = link_get_by_index(m, ifindex, &link); - if (r < 0 || !link) { + if (r < 0) { if (!m->enumerating) log_warning("rtnl: received nexthop message for link (%"PRIu32") we do not know about, ignoring", ifindex); return 0; diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 44dc63b642..283d515b81 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1719,7 +1719,7 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, Ma } r = link_get_by_index(m, ifindex, &link); - if (r < 0 || !link) { + if (r < 0) { /* when enumerating we might be out of sync, but we will * get the route again, so just ignore it */ if (!m->enumerating)