Skip to content

Commit

Permalink
NEEDS SQUASHING gnrc_ipv6_netif: fixed crash when ENABLE_DEBUG is 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonezawa-T2 committed Jan 6, 2016
1 parent 222e385 commit 48375f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions sys/include/net/gnrc/ipv6/netif.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ ipv6_addr_t *gnrc_ipv6_netif_find_addr(kernel_pid_t pid, const ipv6_addr_t *addr
* @param[out] out The reference to the found address on the interface.
* Must be a pointer to NULL on calling and may stay
* unchanged if no match can be found.
* Must not be NULL.
*
* @param[in] prefix The prefix you want to search for.
*
Expand Down
5 changes: 1 addition & 4 deletions sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,7 @@ kernel_pid_t gnrc_ipv6_netif_find_by_prefix(ipv6_addr_t **out, const ipv6_addr_t
match = _find_by_prefix_unsafe(&tmp_res, ipv6_ifs + i, prefix, NULL);

if (match > best_match) {
if (out != NULL) {
*out = tmp_res;
}

*out = tmp_res;
res = ipv6_ifs[i].pid;
best_match = match;
}
Expand Down
3 changes: 2 additions & 1 deletion sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ bool _parse_options(int msg_type, gnrc_rpl_instance_t *inst, gnrc_rpl_opt_t *opt
case (GNRC_RPL_OPT_TARGET):
DEBUG("RPL: RPL TARGET DAO option parsed\n");
*included_opts |= ((uint32_t) 1) << GNRC_RPL_OPT_TARGET;
if_id = gnrc_ipv6_netif_find_by_prefix(NULL, &dodag->dodag_id);
ipv6_addr_t *prefix = NULL;
if_id = gnrc_ipv6_netif_find_by_prefix(&prefix, &dodag->dodag_id);
if (if_id == KERNEL_PID_UNDEF) {
DEBUG("RPL: no interface found for the configured DODAG id\n");
return false;
Expand Down

0 comments on commit 48375f0

Please sign in to comment.