diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 16:19:08 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-03 16:19:08 -0600 |
commit | 75ef2d9d0b2df68a7914d8eeeb7a70024b7d79c5 (patch) | |
tree | f15e7eb83b334eaabe2ec25454fea4a3c264282a /apps | |
parent | c58d132a95d6b912e53c355c3fcc65a64e75bd6a (diff) | |
download | px4-nuttx-75ef2d9d0b2df68a7914d8eeeb7a70024b7d79c5.tar.gz px4-nuttx-75ef2d9d0b2df68a7914d8eeeb7a70024b7d79c5.tar.bz2 px4-nuttx-75ef2d9d0b2df68a7914d8eeeb7a70024b7d79c5.zip |
ICMPv6: Some initial bugfix from first tests of the ICMPv6 auto-configuration logic. so far so good but a lot more testing is needed
Diffstat (limited to 'apps')
-rw-r--r-- | apps/examples/nettest/Kconfig | 2 | ||||
-rw-r--r-- | apps/examples/udp/Kconfig | 2 | ||||
-rw-r--r-- | apps/nshlib/nsh_netinit.c | 12 |
3 files changed, 13 insertions, 3 deletions
diff --git a/apps/examples/nettest/Kconfig b/apps/examples/nettest/Kconfig index 49d885a80..0c021dd6f 100644 --- a/apps/examples/nettest/Kconfig +++ b/apps/examples/nettest/Kconfig @@ -324,7 +324,7 @@ config EXAMPLES_NETTEST_IPv6NETMASK_8 individually. This is the eighth of the 8-values. The default for all eight values is fe00::0. -#endif /* NET_ICMPv6_AUTOCONF */ +endif # NET_ICMPv6_AUTOCONF comment "Client IPv6 address" diff --git a/apps/examples/udp/Kconfig b/apps/examples/udp/Kconfig index ff357750e..eeb51c3e7 100644 --- a/apps/examples/udp/Kconfig +++ b/apps/examples/udp/Kconfig @@ -304,7 +304,7 @@ config EXAMPLES_UDP_IPv6NETMASK_8 individually. This is the eighth of the 8-values. The default for all eight values is fe00::0. -#endif /* NET_ICMPv6_AUTOCONF */ +endif # NET_ICMPv6_AUTOCONF comment "Server IPv6 address" diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index 1c4722909..e0457f97f 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -111,6 +111,16 @@ # error ERROR: No link layer protocol defined #endif +/* We need a valid IP domain (any domain) to create a socket that we can use + * to comunicate with the network device. + */ + +#if defined(CONFIG_NET_IPv4) +# define AF_INETX AF_INET +#elif defined(CONFIG_NET_IPv6) +# define AF_INETX AF_INET6 +#endif + /* While the network is up, the network monitor really does nothing. It * will wait for a very long time while waiting, it can be awakened by a * signal indicating a change in network status. @@ -388,7 +398,7 @@ static int nsh_netinit_monitor(void) * interface driver. */ - sd = socket(AF_INET, SOCK_DGRAM, 0); + sd = socket(AF_INETX, SOCK_DGRAM, 0); if (sd < 0) { ret = -errno; |