net: route: Check NULL value in debug print
In net_route_add(), do not try to print route information if route to neighbor is not found. Coverity-CID: 188172 Fixes #10091 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
c57f3a09bc
commit
3b8c37de45
|
@ -366,13 +366,16 @@ struct net_route_entry *net_route_add(struct net_if *iface,
|
|||
|
||||
tmp = net_route_get_nexthop(route);
|
||||
nbr = net_ipv6_nbr_lookup(iface, tmp);
|
||||
llstorage = net_nbr_get_lladdr(nbr->idx);
|
||||
if (nbr) {
|
||||
llstorage = net_nbr_get_lladdr(nbr->idx);
|
||||
|
||||
NET_DBG("Removing the oldest route %s via %s [%s]",
|
||||
net_sprint_ipv6_addr(&route->addr),
|
||||
net_sprint_ipv6_addr(tmp),
|
||||
net_sprint_ll_addr(llstorage->addr,
|
||||
llstorage->len));
|
||||
NET_DBG("Removing the oldest route %s "
|
||||
"via %s [%s]",
|
||||
net_sprint_ipv6_addr(&route->addr),
|
||||
net_sprint_ipv6_addr(tmp),
|
||||
net_sprint_ll_addr(llstorage->addr,
|
||||
llstorage->len));
|
||||
}
|
||||
} while (0);
|
||||
#endif /* CONFIG_NET_DEBUG_ROUTE */
|
||||
|
||||
|
|
Loading…
Reference in a new issue