diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-20 18:14:09 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-20 18:14:09 -0600 |
commit | 76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5 (patch) | |
tree | eaaa435435196e67cd8bcdc0332530f8966094e9 /apps | |
parent | 85b02aa80df6d162d17f3eaef4290c7e92a655e0 (diff) | |
download | px4-nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.tar.gz px4-nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.tar.bz2 px4-nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.zip |
Correct name of fields in struct sockaddr_in6: sin6_port and sin6_family, not sin_port and sin_family
Diffstat (limited to 'apps')
-rw-r--r-- | apps/netutils/dnsclient/dns_socket.c | 9 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setdripv6addr.c | 6 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setipv6addr.c | 6 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setipv6netmask.c | 6 | ||||
-rw-r--r-- | apps/nshlib/Kconfig | 56 | ||||
-rw-r--r-- | apps/nshlib/nsh_mntcmds.c | 4 | ||||
-rw-r--r-- | apps/nshlib/nsh_routecmds.c | 26 |
7 files changed, 54 insertions, 59 deletions
diff --git a/apps/netutils/dnsclient/dns_socket.c b/apps/netutils/dnsclient/dns_socket.c index 76cf64a33..693aae7f7 100644 --- a/apps/netutils/dnsclient/dns_socket.c +++ b/apps/netutils/dnsclient/dns_socket.c @@ -546,12 +546,15 @@ void dns_setserver(FAR const struct in6_addr *dnsserver) void dns_setserver(FAR const struct in_addr *dnsserver) #endif { - g_dnsserver.sin_family = AF_INET; - g_dnsserver.sin_port = HTONS(53); - #ifdef CONFIG_NETUTILS_DNSCLIENT_IPv6 + g_dnsserver.sin6_family = AF_INET6; + g_dnsserver.sin6_port = HTONS(53); + memcpy(&g_dnsserver.sin6_addr, dnsserver, ADDRLEN); #else + g_dnsserver.sin_family = AF_INET; + g_dnsserver.sin_port = HTONS(53); + g_dnsserver.sin_addr.s_addr = dnsserver->s_addr; #endif } diff --git a/apps/netutils/netlib/netlib_setdripv6addr.c b/apps/netutils/netlib/netlib_setdripv6addr.c index d339e6b87..aed620b0b 100644 --- a/apps/netutils/netlib/netlib_setdripv6addr.c +++ b/apps/netutils/netlib/netlib_setdripv6addr.c @@ -90,9 +90,9 @@ int netlib_set_dripv6addr(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFDSTADDR, (unsigned long)((uintptr_t)&req)); diff --git a/apps/netutils/netlib/netlib_setipv6addr.c b/apps/netutils/netlib/netlib_setipv6addr.c index 8a5d8be80..e4d4c179a 100644 --- a/apps/netutils/netlib/netlib_setipv6addr.c +++ b/apps/netutils/netlib/netlib_setipv6addr.c @@ -90,9 +90,9 @@ int netlib_set_ipv6addr(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFADDR, ((unsigned long)(uintptr_t)&req)); diff --git a/apps/netutils/netlib/netlib_setipv6netmask.c b/apps/netutils/netlib/netlib_setipv6netmask.c index f092790a2..fc9d67f37 100644 --- a/apps/netutils/netlib/netlib_setipv6netmask.c +++ b/apps/netutils/netlib/netlib_setipv6netmask.c @@ -89,9 +89,9 @@ int netlib_set_ipv6netmask(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFNETMASK, (unsigned long)((uintptr_t)&req)); diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index dd4676a59..3805ffff4 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -944,7 +944,7 @@ config NSH_IPv6ADDR_1 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the first of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_2 hex "[1]" @@ -955,7 +955,7 @@ config NSH_IPv6ADDR_2 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the second of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_3 hex "[2]" @@ -966,7 +966,7 @@ config NSH_IPv6ADDR_3 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the third of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_4 hex "[3]" @@ -977,7 +977,7 @@ config NSH_IPv6ADDR_4 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fourth of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_5 hex "[4]" @@ -988,7 +988,7 @@ config NSH_IPv6ADDR_5 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fifth of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_6 hex "[5]" @@ -999,7 +999,7 @@ config NSH_IPv6ADDR_6 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the sixth of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_7 hex "[6]" @@ -1010,7 +1010,7 @@ config NSH_IPv6ADDR_7 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the seventh of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. config NSH_IPv6ADDR_8 hex "[7]" @@ -1021,7 +1021,7 @@ config NSH_IPv6ADDR_8 provided. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the last of the 8-values. The default for - all eight values is fc00:0000:0000:0000:0000:0000:0000:0002. + all eight values is fc00::2. endif # !NSH_DHCPC @@ -1035,8 +1035,7 @@ config NSH_DRIPv6ADDR_1 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the first of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_2 hex "[1]" @@ -1046,8 +1045,7 @@ config NSH_DRIPv6ADDR_2 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the second of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_3 hex "[2]" @@ -1057,8 +1055,7 @@ config NSH_DRIPv6ADDR_3 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the third of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_4 hex "[3]" @@ -1068,8 +1065,7 @@ config NSH_DRIPv6ADDR_4 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fourth of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_5 hex "[4]" @@ -1079,8 +1075,7 @@ config NSH_DRIPv6ADDR_5 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fifth of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_6 hex "[5]" @@ -1090,8 +1085,7 @@ config NSH_DRIPv6ADDR_6 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the sixth of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_7 hex "[6]" @@ -1101,8 +1095,7 @@ config NSH_DRIPv6ADDR_7 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the seventh of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. config NSH_DRIPv6ADDR_8 hex "[7]" @@ -1112,8 +1105,7 @@ config NSH_DRIPv6ADDR_8 Default router IP address (aka, Gateway). This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the last of the - 8-values. The default for all eight values is - fc00:0000:0000:0000:0000:0000:0000:0001. + 8-values. The default for all eight values is fc00::1. comment "IPv6 Network mask" @@ -1125,7 +1117,7 @@ config NSH_IPv6NETMASK_1 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the first of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_2 hex "[1]" @@ -1135,7 +1127,7 @@ config NSH_IPv6NETMASK_2 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the second of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_3 hex "[2]" @@ -1145,7 +1137,7 @@ config NSH_IPv6NETMASK_3 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the third of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_4 hex "[3]" @@ -1155,7 +1147,7 @@ config NSH_IPv6NETMASK_4 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fourth of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_5 hex "[4]" @@ -1165,7 +1157,7 @@ config NSH_IPv6NETMASK_5 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the fifth of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_6 hex "[5]" @@ -1175,7 +1167,7 @@ config NSH_IPv6NETMASK_6 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the sixth of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_7 hex "[6]" @@ -1185,7 +1177,7 @@ config NSH_IPv6NETMASK_7 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the seventh of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. config NSH_IPv6NETMASK_8 hex "[7]" @@ -1195,7 +1187,7 @@ config NSH_IPv6NETMASK_8 Network mask. This is a 16-bit integer value in host order. Each of the eight values forming the full IP address must be specified individually. This is the eighth of the 8-values. The default for - all eight values is fe00:0000:0000:0000:0000:0000:0000:0000. + all eight values is fe00::0. endif #NET_IPv6 endmenu # IP Address Configuration diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index 55d9df9b6..6857947c5 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -534,8 +534,8 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) #ifdef CONFIG_NET_IPv6 sin = (FAR struct sockaddr_in6 *)&data.addr; - sin->sin_family = AF_INET6; - sin->sin_port = htons(NFS_PMAPPORT); + sin->sin6_family = AF_INET6; + sin->sin6_port = htons(NFS_PMAPPORT); memcpy(&sin->sin6_addr, &inaddr, sizeof(struct in6_addr)); data.addrlen = sizeof(struct sockaddr_in6); #else diff --git a/apps/nshlib/nsh_routecmds.c b/apps/nshlib/nsh_routecmds.c index 30489332a..3cf27050d 100644 --- a/apps/nshlib/nsh_routecmds.c +++ b/apps/nshlib/nsh_routecmds.c @@ -135,7 +135,7 @@ int cmd_addroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) memset(&target, 0, sizeof(target)); #ifdef CONFIG_NET_IPv6 - target.sin_family = AF_INET6; + target.sin6_family = AF_INET6; memcpy(&target.sin6_addr, &inaddr, sizeof(struct in6_addr)); #else target.sin_family = AF_INET; @@ -159,11 +159,11 @@ int cmd_addroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) memset(&netmask, 0, sizeof(netmask)); #ifdef CONFIG_NET_IPv6 - netmask.sin_family = AF_INET6; + netmask.sin6_family = AF_INET6; memcpy(&netmask.sin6_addr, &inaddr, sizeof(struct in6_addr)); #else - netmask.sin_family = AF_INET; - netmask.sin_addr = inaddr; + netmask.sin_family = AF_INET; + netmask.sin_addr = inaddr; #endif /* Convert the router IP address string into its binary form */ @@ -183,11 +183,11 @@ int cmd_addroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) memset(&router, 0, sizeof(router)); #ifdef CONFIG_NET_IPv6 - router.sin_family = AF_INET6; + router.sin6_family = AF_INET6; memcpy(&router.sin6_addr, &inaddr, sizeof(struct in6_addr)); #else - router.sin_family = AF_INET; - router.sin_addr = inaddr; + router.sin_family = AF_INET; + router.sin_addr = inaddr; #endif /* Then add the route */ @@ -263,11 +263,11 @@ int cmd_delroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) memset(&target, 0, sizeof(target)); #ifdef CONFIG_NET_IPv6 - target.sin_family = AF_INET6; + target.sin6_family = AF_INET6; memcpy(&target.sin6_addr, &inaddr, sizeof(struct in6_addr)); #else - target.sin_family = AF_INET; - target.sin_addr = inaddr; + target.sin_family = AF_INET; + target.sin_addr = inaddr; #endif /* Convert the netmask IP address string into its binary form */ @@ -287,11 +287,11 @@ int cmd_delroute(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) memset(&netmask, 0, sizeof(netmask)); #ifdef CONFIG_NET_IPv6 - netmask.sin_family = AF_INET6; + netmask.sin6_family = AF_INET6; memcpy(&netmask.sin6_addr, &inaddr, sizeof(struct in6_addr)); #else - netmask.sin_family = AF_INET; - netmask.sin_addr = inaddr; + netmask.sin_family = AF_INET; + netmask.sin_addr = inaddr; #endif /* Then delete the route */ |