net: route: Check that neighbor exists before deleting it
If the neighbour does not exists, then the route to it cannot be deleted so we can return error to caller in that case. Coverity-CID: 188173 Fixes #10090 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
3b8c37de45
commit
02e9f9c8e6
|
@ -531,6 +531,9 @@ int net_route_del_by_nexthop_data(struct net_if *iface,
|
|||
NET_ASSERT(nexthop);
|
||||
|
||||
nbr_nexthop = net_ipv6_nbr_lookup(iface, nexthop);
|
||||
if (!nbr_nexthop) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < CONFIG_NET_MAX_ROUTES; i++) {
|
||||
struct net_nbr *nbr = get_nbr(i);
|
||||
|
|
Loading…
Reference in a new issue