First round of compile fixes for IPv6
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4813 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
bae9504fad
commit
d4569952c7
@ -92,7 +92,6 @@ int uip_gethostaddr(const char *ifname, struct in_addr *addr)
|
||||
if (!ret)
|
||||
{
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#error "req.ifr_addr.s_addr not big enough for IPv6 address"
|
||||
memcpy(addr, &req.ifr_addr, sizeof(struct in6_addr));
|
||||
#else
|
||||
memcpy(addr, &req.ifr_addr, sizeof(struct in_addr));
|
||||
|
@ -96,7 +96,6 @@ int uip_setdraddr(const char *ifname, const struct in_addr *addr)
|
||||
/* Add the INET address to the request */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#error "req.ifr_addr.s_addr not big enough for IPv6 address"
|
||||
inaddr = (struct sockaddr_in6 *)&req.ifr_addr;
|
||||
inaddr->sin_family = AF_INET6;
|
||||
inaddr->sin_port = 0;
|
||||
|
@ -96,7 +96,6 @@ int uip_sethostaddr(const char *ifname, const struct in_addr *addr)
|
||||
/* Add the INET address to the request */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#error "req.ifr_addr.s_addr not big enough for IPv6 address"
|
||||
inaddr = (struct sockaddr_in6 *)&req.ifr_addr;
|
||||
inaddr->sin_family = AF_INET6;
|
||||
inaddr->sin_port = 0;
|
||||
|
@ -95,7 +95,6 @@ int uip_setnetmask(const char *ifname, const struct in_addr *addr)
|
||||
/* Add the INET address to the request */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#error "req.ifr_addr.s_addr not big enough for IPv6 address"
|
||||
inaddr = (struct sockaddr_in6 *)&req.ifr_addr;
|
||||
inaddr->sin_family = AF_INET6;
|
||||
inaddr->sin_port = 0;
|
||||
|
@ -1226,11 +1226,12 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
FAR char *address;
|
||||
FAR char *lpath;
|
||||
FAR char *rpath;
|
||||
FAR struct sockaddr_in *sin;
|
||||
bool badarg = false;
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
FAR struct sockaddr_in6 *sin;
|
||||
struct in6_addr inaddr;
|
||||
#else
|
||||
FAR struct sockaddr_in *sin;
|
||||
struct in_addr inaddr;
|
||||
#endif
|
||||
bool tcp = false;
|
||||
@ -1346,11 +1347,19 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
sin = (FAR struct sockaddr_in6 *)&data.addr;
|
||||
sin->sin_family = AF_INET6;
|
||||
sin->sin_port = htons(NFS_PMAPPORT);
|
||||
memcpy(&sin->sin6_addr, &inaddr, sizeof(struct in6_addr));
|
||||
data.addrlen = sizeof(struct sockaddr_in6);
|
||||
#else
|
||||
sin = (FAR struct sockaddr_in *)&data.addr;
|
||||
sin->sin_family = AF_INET;
|
||||
sin->sin_port = htons(NFS_PMAPPORT);
|
||||
sin->sin_addr = inaddr;
|
||||
data.addrlen = sizeof(struct sockaddr_in);
|
||||
#endif
|
||||
|
||||
data.version = NFS_ARGSVERSION;
|
||||
data.sotype = (tcp) ? SOCK_STREAM : SOCK_DGRAM;
|
||||
|
Loading…
Reference in New Issue
Block a user