diff --git a/sys/include/net/gnrc/ipv6/netif.h b/sys/include/net/gnrc/ipv6/netif.h index 3385003f90a574cc76bfcf8d53b926e12e9284b7..637a563dd469a056e1ca9e0c5ef62d4f6fe0ba01 100644 --- a/sys/include/net/gnrc/ipv6/netif.h +++ b/sys/include/net/gnrc/ipv6/netif.h @@ -484,6 +484,8 @@ ipv6_addr_t *gnrc_ipv6_netif_find_addr(kernel_pid_t pid, const ipv6_addr_t *addr * * @param[in] prefix The prefix you want to search for. * + * @pre @p out must not be NULL. + * * @return The PID to the interface the address is registered to. * @return KERNEL_PID_UNDEF, if no matching address can not be found on any * interface. diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index 1fbcc47e8c3edb15895f482d5cd31ee9aa81a993..e927b21a448a7f8622e12a61caf9ad903fe93cf2 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -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; } diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c b/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c index 297ec132c92e66010f7e19042e1deb4ea9d68c2c..39eefa25be55563d89efc0768a3c1546d887e6eb 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c @@ -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;