diff options
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/rresvport.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/net/rresvport.c b/lib/libc/net/rresvport.c index e544424cee4..21387aa3b13 100644 --- a/lib/libc/net/rresvport.c +++ b/lib/libc/net/rresvport.c @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rresvport.c,v 1.3 1999/12/17 19:20:30 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rresvport.c,v 1.4 1999/12/17 20:48:03 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -81,11 +81,11 @@ rresvport_af(alport, af) switch (af) { case AF_INET: sa->sa_len = sizeof(struct sockaddr_in); - portp = &((struct sockaddr_in *)&sa)->sin_port; + portp = &((struct sockaddr_in *)sa)->sin_port; break; case AF_INET6: sa->sa_len = sizeof(struct sockaddr_in6); - portp = &((struct sockaddr_in6 *)&sa)->sin6_port; + portp = &((struct sockaddr_in6 *)sa)->sin6_port; break; default: errno = EPFNOSUPPORT; @@ -112,6 +112,6 @@ rresvport_af(alport, af) (void)close(s); return (-1); } - *alport = *portp; + *alport = ntohs(*portp); return (s); } |