summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_netinit.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-02-03 08:01:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-02-03 08:01:55 -0600
commitd2dd063179ec9ab25b0db59573aa5231ba82ad93 (patch)
treee1daaf9acdcc41cfff736d7d56babbe1c59045d2 /apps/nshlib/nsh_netinit.c
parent5facd80a972df125a152f2ac2493441c18985b51 (diff)
downloadpx4-nuttx-d2dd063179ec9ab25b0db59573aa5231ba82ad93.tar.gz
px4-nuttx-d2dd063179ec9ab25b0db59573aa5231ba82ad93.tar.bz2
px4-nuttx-d2dd063179ec9ab25b0db59573aa5231ba82ad93.zip
Add netlib and application hooks for ICMPv6 auto-configuration (still incomplete
Diffstat (limited to 'apps/nshlib/nsh_netinit.c')
-rw-r--r--apps/nshlib/nsh_netinit.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
index d2ea3520f..c2b8bf952 100644
--- a/apps/nshlib/nsh_netinit.c
+++ b/apps/nshlib/nsh_netinit.c
@@ -132,14 +132,9 @@ static sem_t g_notify_sem;
#endif
#ifdef CONFIG_NET_IPv6
- /* Host IPv6 address */
+#ifndef CONFIG_NET_ICMPv6_AUTOCONF
+/* Host IPv6 address */
-#ifdef CONFIG_NSH_DHCPC
-static const uint16_t g_ipv6_hostaddr[8] =
-{
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-#else
static const uint16_t g_ipv6_hostaddr[8] =
{
HTONS(CONFIG_NSH_IPv6ADDR_1),
@@ -151,7 +146,7 @@ static const uint16_t g_ipv6_hostaddr[8] =
HTONS(CONFIG_NSH_IPv6ADDR_7),
HTONS(CONFIG_NSH_IPv6ADDR_8),
};
-#endif
+#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
/* Default routine IPv6 address */
@@ -260,10 +255,18 @@ static void nsh_netinit_configure(void)
#endif
#ifdef CONFIG_NET_IPv6
- /* Set up our host address */
+#ifdef CONFIG_NET_ICMPv6_AUTOCONF
+ /* Perform ICMPv6 auto-configuration */
+
+ netlib_icmpv6_autoconfiguration(NET_DEVNAME);
+
+#else
+
+ /* Set up our fixed host address */
netlib_set_ipv6addr(NET_DEVNAME,
(FAR const struct in6_addr *)g_ipv6_hostaddr);
+#endif
/* Set up the default router address */