summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_netinit.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-02-03 15:40:56 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-02-03 15:40:56 -0600
commit87bc48cc1efcedaae3bf1b176168ff3dc17637f7 (patch)
tree6953f9f33fcd7b75ec0019268bd13b3569099da8 /apps/nshlib/nsh_netinit.c
parentbe5a9dbe26d3d362a250d7fbff2923090a144032 (diff)
downloadpx4-nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.tar.gz
px4-nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.tar.bz2
px4-nuttx-87bc48cc1efcedaae3bf1b176168ff3dc17637f7.zip
ICMPv6: This completes coding of the ICMPv6 auto-configuration feature. It is not yet functional
Diffstat (limited to 'apps/nshlib/nsh_netinit.c')
-rw-r--r--apps/nshlib/nsh_netinit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
index c2b8bf952..1c4722909 100644
--- a/apps/nshlib/nsh_netinit.c
+++ b/apps/nshlib/nsh_netinit.c
@@ -131,8 +131,7 @@
static sem_t g_notify_sem;
#endif
-#ifdef CONFIG_NET_IPv6
-#ifndef CONFIG_NET_ICMPv6_AUTOCONF
+#if defined(CONFIG_NET_IPv6) && !defined(CONFIG_NET_ICMPv6_AUTOCONF)
/* Host IPv6 address */
static const uint16_t g_ipv6_hostaddr[8] =
@@ -146,7 +145,6 @@ static const uint16_t g_ipv6_hostaddr[8] =
HTONS(CONFIG_NSH_IPv6ADDR_7),
HTONS(CONFIG_NSH_IPv6ADDR_8),
};
-#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
/* Default routine IPv6 address */
@@ -175,7 +173,7 @@ static const uint16_t g_ipv6_netmask[8] =
HTONS(CONFIG_NSH_IPv6NETMASK_7),
HTONS(CONFIG_NSH_IPv6NETMASK_8),
};
-#endif /* CONFIG_NET_IPv6 */
+#endif /* CONFIG_NET_IPv6 && !CONFIG_NET_ICMPv6_AUTOCONF*/
/****************************************************************************
* Private Function Prototypes
@@ -260,13 +258,12 @@ static void nsh_netinit_configure(void)
netlib_icmpv6_autoconfiguration(NET_DEVNAME);
-#else
+#else /* CONFIG_NET_ICMPv6_AUTOCONF */
/* 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 */
@@ -277,7 +274,9 @@ static void nsh_netinit_configure(void)
netlib_set_ipv6netmask(NET_DEVNAME,
(FAR const struct in6_addr *)g_ipv6_netmask);
-#endif
+
+#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
+#endif /* CONFIG_NET_IPv6 */
#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
/* Set up the resolver */