Merge pull request #12513 from miri64/gnrc_ipv6_fix/fix/auto-config-with-no-slaac-but-6ln

gnrc_ipv6_nib: don't auto-configure IPv6 w/o SLAAC on non-6LN interface
This commit is contained in:
Cenk Gündoğan 2019-10-21 01:01:46 +02:00 committed by GitHub
commit e66283f12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@
#include <stdbool.h>
#include "log.h"
#include "luid.h"
#include "net/gnrc/netif/internal.h"
@ -34,6 +35,15 @@ 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 !GNRC_IPV6_NIB_CONF_SLAAC
if (!gnrc_netif_is_6ln(netif)) {
LOG_WARNING("SLAAC not activated; will not auto-configure IPv6 address "
"for interface %u.\n"
" Use GNRC_IPV6_NIB_CONF_SLAAC=1 to activate.\n",
netif->pid);
return;
}
#endif
if (!(netif->flags & GNRC_NETIF_FLAGS_HAS_L2ADDR)) {
DEBUG("nib: interface %i has no link-layer addresses\n", netif->pid);
return;