1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_netif: fail IPv6 address addition if no space for solicited nodes

This commit is contained in:
Martine Lenders 2018-05-29 15:50:10 +02:00 committed by Martine Lenders
parent 32413f872e
commit ea64d39e21
2 changed files with 6 additions and 4 deletions

View File

@ -87,7 +87,8 @@ void gnrc_netif_release(gnrc_netif_t *netif);
* @note Only available with @ref net_gnrc_ipv6 "gnrc_ipv6".
*
* @return >= 0, on success
* @return -ENOMEM, when no space for new addresses is left on the interface
* @return -ENOMEM, when no space for new addresses (or its solicited nodes
* multicast address) is left on the interface
*/
int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif,
const ipv6_addr_t *addr,

View File

@ -555,9 +555,6 @@ int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif,
gnrc_netif_release(netif);
return -ENOMEM;
}
netif->ipv6.addrs_flags[idx] = flags;
memcpy(&netif->ipv6.addrs[idx], addr, sizeof(netif->ipv6.addrs[idx]));
#ifdef MODULE_GNRC_IPV6_NIB
#if GNRC_IPV6_NIB_CONF_ARSM
ipv6_addr_t sol_nodes;
int res;
@ -570,8 +567,12 @@ int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif,
DEBUG("nib: Can't join solicited-nodes of %s on interface %u\n",
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)),
netif->pid);
return res;
}
#endif /* GNRC_IPV6_NIB_CONF_ARSM */
netif->ipv6.addrs_flags[idx] = flags;
memcpy(&netif->ipv6.addrs[idx], addr, sizeof(netif->ipv6.addrs[idx]));
#ifdef MODULE_GNRC_IPV6_NIB
if (_get_state(netif, idx) == GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_VALID) {
void *state = NULL;
gnrc_ipv6_nib_pl_t ple;