diff options
Diffstat (limited to 'apps/examples/nettest/nettest.c')
-rw-r--r-- | apps/examples/nettest/nettest.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/examples/nettest/nettest.c b/apps/examples/nettest/nettest.c index e4c9a1db3..b03b288c1 100644 --- a/apps/examples/nettest/nettest.c +++ b/apps/examples/nettest/nettest.c @@ -60,8 +60,7 @@ * Private Data ****************************************************************************/ -#ifdef CONFIG_EXAMPLES_NETTEST_IPv6 -#ifndef CONFIG_NET_ICMPv6_AUTOCONF +#if defined(CONFIG_EXAMPLES_NETTEST_IPv6) && !defined(CONFIG_NET_ICMPv6_AUTOCONF) /* Our host IPv6 address */ static const uint16_t g_ipv6_hostaddr[8] = @@ -75,7 +74,6 @@ static const uint16_t g_ipv6_hostaddr[8] = HTONS(CONFIG_EXAMPLES_NETTEST_IPv6ADDR_7), HTONS(CONFIG_EXAMPLES_NETTEST_IPv6ADDR_8), }; -#endif /* Default routine IPv6 address */ @@ -104,7 +102,7 @@ static const uint16_t g_ipv6_netmask[8] = HTONS(CONFIG_EXAMPLES_NETTEST_IPv6NETMASK_7), HTONS(CONFIG_EXAMPLES_NETTEST_IPv6NETMASK_8), }; -#endif /* CONFIG_EXAMPLES_NETTEST_IPv6 */ +#endif /* CONFIG_EXAMPLES_NETTEST_IPv6 && !CONFIG_NET_ICMPv6_AUTOCONF */ /**************************************************************************** * Public Functions @@ -145,12 +143,12 @@ int nettest_main(int argc, char *argv[]) netlib_icmpv6_autoconfiguration("eth0"); -#else +#else /* CONFIG_NET_ICMPv6_AUTOCONF */ + /* 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 */ @@ -161,7 +159,10 @@ int nettest_main(int argc, char *argv[]) netlib_set_ipv6netmask("eth0", (FAR const struct in6_addr *)g_ipv6_netmask); -#else + +#endif /* CONFIG_NET_ICMPv6_AUTOCONF */ +#else /* CONFIG_EXAMPLES_NETTEST_IPv6 */ + /* Set up our host address */ addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_IPADDR); @@ -176,7 +177,8 @@ int nettest_main(int argc, char *argv[]) addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_NETMASK); netlib_set_ipv4netmask("eth0", &addr); -#endif + +#endif /* CONFIG_EXAMPLES_NETTEST_IPv6 */ #ifdef CONFIG_EXAMPLES_NETTEST_SERVER recv_server(); |