diff options
author | yar <yar@FreeBSD.org> | 2002-07-17 19:07:07 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2002-07-17 19:07:07 +0000 |
commit | ab8d11d3a98e2c61ad075acff7ec3742a551f736 (patch) | |
tree | 06c920ac972e9258df7119d9d2f89095f6bcdff7 /libexec | |
parent | 5252eb95e95c1c1a9dfad01df27e4abc174deee9 (diff) | |
download | FreeBSD-src-ab8d11d3a98e2c61ad075acff7ec3742a551f736.zip FreeBSD-src-ab8d11d3a98e2c61ad075acff7ec3742a551f736.tar.gz |
Fix setting parameters for getipnodebyaddr(3):
o "struct addrinfo" contains a pointer to "struct sockaddr,"
not "struct sockaddr" itself
o the function takes a pointer to "struct in*_addr", not to
"struct sockaddr," so the address length must be corresponding
MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index f758e95..f669020 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -787,12 +787,12 @@ inithosts(void) /* XXX: getaddrinfo() can't do alias check */ switch(hrp->hostinfo->ai_family) { case AF_INET: - addr = &((struct sockaddr_in *)&hrp->hostinfo->ai_addr)->sin_addr; - addrsize = sizeof(struct sockaddr_in); + addr = &((struct sockaddr_in *)hrp->hostinfo->ai_addr)->sin_addr; + addrsize = sizeof(struct in_addr); break; case AF_INET6: - addr = &((struct sockaddr_in6 *)&hrp->hostinfo->ai_addr)->sin6_addr; - addrsize = sizeof(struct sockaddr_in6); + addr = &((struct sockaddr_in6 *)hrp->hostinfo->ai_addr)->sin6_addr; + addrsize = sizeof(struct in6_addr); break; default: /* should not reach here */ |