diff --git a/core/contiki-default-conf.h b/core/contiki-default-conf.h index df7fe9e6d..0083f7e10 100644 --- a/core/contiki-default-conf.h +++ b/core/contiki-default-conf.h @@ -192,10 +192,24 @@ #define NBR_TABLE_CONF_MAX_NEIGHBORS 8 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */ +/* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement. + * We enable it by default when IPv6 is used without RPL. */ +#ifndef UIP_CONF_ND6_SEND_RA +#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#endif /* UIP_CONF_ND6_SEND_RA */ + /* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol. - This is unneeded when RPL is used. Disable to save ROM and a little RAM. */ + We enable it by default when IPv6 is used without RPL. + With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping) + is fed whenever receiving DIO and DAO messages. This is always sufficient + for RPL routing, i.e. to send to the preferred parent or any child. + Link-local unicast to other neighbors may, however, not be possible if + we never receive any DIO from them. This may happen if the link from the + neighbor to us is weak, if DIO transmissions are suppressed (Trickle + timer) or if the neighbor chooses not to transmit DIOs because it is + a leaf node or for any reason. */ #ifndef UIP_CONF_ND6_SEND_NA -#define UIP_CONF_ND6_SEND_NA 1 +#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) #endif /* UIP_CONF_ND6_SEND_NA */ /*---------------------------------------------------------------------------*/ diff --git a/examples/cc2530dk/udp-ipv6/project-conf.h b/examples/cc2530dk/udp-ipv6/project-conf.h index fb37ebfc3..adb4fc0f0 100644 --- a/examples/cc2530dk/udp-ipv6/project-conf.h +++ b/examples/cc2530dk/udp-ipv6/project-conf.h @@ -45,5 +45,6 @@ #define BUTTON_SENSOR_CONF_ON 1 #define UIP_CONF_ICMP6 1 #define RIMESTATS_CONF_ENABLED 1 +#define UIP_CONF_ND6_SEND_NA 1 #endif /* PROJECT_CONF_H_ */ diff --git a/examples/cc2538dk/udp-ipv6-echo-server/Makefile b/examples/cc2538dk/udp-ipv6-echo-server/Makefile index 32b3ca79f..4988d0b52 100644 --- a/examples/cc2538dk/udp-ipv6-echo-server/Makefile +++ b/examples/cc2538dk/udp-ipv6-echo-server/Makefile @@ -4,4 +4,5 @@ all: $(CONTIKI_PROJECT) CONTIKI = ../../.. CONTIKI_WITH_IPV6 = 1 +CFLAGS += -DUIP_CONF_ND6_SEND_NA=1 include $(CONTIKI)/Makefile.include diff --git a/examples/sensinode/udp-ipv6/project-conf.h b/examples/sensinode/udp-ipv6/project-conf.h index 4e74d406e..bb755aee9 100644 --- a/examples/sensinode/udp-ipv6/project-conf.h +++ b/examples/sensinode/udp-ipv6/project-conf.h @@ -47,5 +47,6 @@ #define BUTTON_SENSOR_CONF_ON 1 #define RIMESTATS_CONF_ENABLED 1 #define VIZTOOL_CONF_ON 0 +#define UIP_CONF_ND6_SEND_NA 1 #endif /* PROJECT_CONF_H_ */ diff --git a/examples/udp-ipv6/Makefile b/examples/udp-ipv6/Makefile index 62118cb49..7a38bdbc5 100644 --- a/examples/udp-ipv6/Makefile +++ b/examples/udp-ipv6/Makefile @@ -2,4 +2,5 @@ all: udp-server udp-client CONTIKI = ../.. CONTIKI_WITH_IPV6 = 1 +CFLAGS += -DUIP_CONF_ND6_SEND_NA=1 include $(CONTIKI)/Makefile.include diff --git a/regression-tests/11-ipv6/code/receiver/project-conf.h b/regression-tests/11-ipv6/code/receiver/project-conf.h index 877ed0ac4..17a25e129 100644 --- a/regression-tests/11-ipv6/code/receiver/project-conf.h +++ b/regression-tests/11-ipv6/code/receiver/project-conf.h @@ -1,4 +1,5 @@ - +#undef UIP_CONF_ND6_SEND_NA +#define UIP_CONF_ND6_SEND_NA 1 #ifdef BUFSIZE #undef UIP_CONF_BUFFER_SIZE diff --git a/regression-tests/11-ipv6/code/sender/project-conf.h b/regression-tests/11-ipv6/code/sender/project-conf.h index 877ed0ac4..17a25e129 100644 --- a/regression-tests/11-ipv6/code/sender/project-conf.h +++ b/regression-tests/11-ipv6/code/sender/project-conf.h @@ -1,4 +1,5 @@ - +#undef UIP_CONF_ND6_SEND_NA +#define UIP_CONF_ND6_SEND_NA 1 #ifdef BUFSIZE #undef UIP_CONF_BUFFER_SIZE