summaryrefslogtreecommitdiff
path: root/apps/examples/udp/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/udp/target.c')
-rw-r--r--apps/examples/udp/target.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c
index 711fe0d02..2d80ac0dc 100644
--- a/apps/examples/udp/target.c
+++ b/apps/examples/udp/target.c
@@ -58,6 +58,7 @@
****************************************************************************/
#ifdef CONFIG_EXAMPLES_UDP_IPv6
+#ifdef CONFIG_NET_ICMPv6_AUTOCONF
/* Our host IPv6 address */
static const uint16_t g_ipv6_hostaddr[8] =
@@ -71,6 +72,7 @@ static const uint16_t g_ipv6_hostaddr[8] =
HTONS(CONFIG_EXAMPLES_UDP_IPv6ADDR_7),
HTONS(CONFIG_EXAMPLES_UDP_IPv6ADDR_8),
};
+#endif
/* Default routine IPv6 address */
@@ -116,10 +118,17 @@ int udp_main(int argc, char *argv[])
#endif
{
#ifdef CONFIG_EXAMPLES_UDP_IPv6
- /* Set up our host address */
+#ifdef CONFIG_NET_ICMPv6_AUTOCONF
+ /* Perform ICMPv6 auto-configuration */
+
+ netlib_icmpv6_autoconfiguration("eth0");
+
+#else
+ /* Set up our fixed host address */
netlib_set_ipv6addr("eth0",
(FAR const struct in6_addr *)g_ipv6_hostaddr);
+#endif
/* Set up the default router address */