From 5732e9bd8868ed5f026b7c0828f4f8c4b7d8f7bd Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 27 Nov 2018 17:47:50 +0100 Subject: [PATCH] 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. --- sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c index e32896d119..1b452b2f35 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c @@ -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);