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

gnrc_ipv6_nib: don't autoconfig IPv6 address without L2 addr

If the interface's link-layer doesn't use link-layer addresses it
obviously doesn't make sense to auto-configure an IPv6 address from it.
Moreover, I think the address `fe80::` is actual illegal, but I
couldn't find any references for it.
This commit is contained in:
Martine Lenders 2018-11-27 17:47:50 +01:00 committed by Martine Lenders
parent 050e06f20f
commit 5732e9bd88

View File

@ -34,6 +34,10 @@ void _auto_configure_addr(gnrc_netif_t *netif, const ipv6_addr_t *pfx,
int idx;
uint8_t flags = GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE;
if (!(netif->flags & GNRC_NETIF_FLAGS_HAS_L2ADDR)) {
DEBUG("nib: interface %i has no link-layer addresses\n", netif->pid);
return;
}
DEBUG("nib: add address based on %s/%u automatically to interface %u\n",
ipv6_addr_to_str(addr_str, pfx, sizeof(addr_str)),
pfx_len, netif->pid);