Skip to content

Commit

Permalink
Merge pull request #4532 from Yonezawa-T2/gnrc_safe_no_routers
Browse files Browse the repository at this point in the history
gnrc_sixlowpan_nd: fixed crash when there are no routers
  • Loading branch information
miri64 committed Dec 22, 2015
2 parents 2d8f6f8 + fe0e58d commit 5b4ef43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ kernel_pid_t gnrc_sixlowpan_nd_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_
next_hop = gnrc_ndp_internal_default_router();
}

/* no routers found */
if (next_hop == NULL) {
return KERNEL_PID_UNDEF;
}

/* address resolution of next_hop: https://tools.ietf.org/html/rfc6775#section-5.7 */
if ((nc_entry == NULL) || (next_hop != dst)) {
/* get if not gotten from previous check */
Expand Down

0 comments on commit 5b4ef43

Please sign in to comment.