Ok.. really get it right this time (that's ntohs, not htons.. need coffee).
This commit is contained in:
parent
da693d7595
commit
4810a01fcf
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: security.c,v 1.4 2000/06/08 08:21:42 fvdl Exp $ */
|
||||
/* $NetBSD: security.c,v 1.5 2000/06/08 09:01:05 fvdl Exp $ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -134,14 +134,14 @@ is_loopback(struct netbuf *nbuf)
|
|||
return 0;
|
||||
sin = (struct sockaddr_in *)addr;
|
||||
return ((sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) &&
|
||||
(htons(sin->sin_port) < IPPORT_RESERVED));
|
||||
(ntohs(sin->sin_port) < IPPORT_RESERVED));
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
if (!oldstyle_local)
|
||||
return 0;
|
||||
sin6 = (struct sockaddr_in6 *)addr;
|
||||
return (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) &&
|
||||
(htons(sin6->sin6_port) < IPV6PORT_RESERVED));
|
||||
(ntohs(sin6->sin6_port) < IPV6PORT_RESERVED));
|
||||
#endif
|
||||
case AF_LOCAL:
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue