Correct name of fields in struct sockaddr_in6: sin6_port and sin6_family, not sin_port and sin_family
This commit is contained in:
parent
8c02b30555
commit
c96aa9218a
@ -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
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user