ip: check for null before ip_get_next_hop is used
This commit is contained in:
parent
bd80cbcaff
commit
2a7ce79947
@ -106,12 +106,13 @@ int ipv6_send_packet(ipv6_hdr_t *packet, ipv6_addr_t *next_hop)
|
||||
|
||||
if (next_hop == NULL) {
|
||||
DEBUG("Trying to find the next hop for %s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &packet->destaddr));
|
||||
ipv6_addr_t *dest = ip_get_next_hop(&packet->destaddr);
|
||||
|
||||
if (ip_get_next_hop == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipv6_addr_t *dest = ip_get_next_hop(&packet->destaddr);
|
||||
|
||||
if (dest == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user