diff options
author | 2003-04-25 19:40:25 +0000 | |
---|---|---|
committer | 2003-04-25 19:40:25 +0000 | |
commit | 531ad6873bb6a5f3a752f5cd18ff0f0475df42f3 (patch) | |
tree | ae1d3853fabb6fafd224d4fb829d8f5b7c452ab1 /lib/libc | |
parent | added two missing .El macros; (diff) | |
download | wireguard-openbsd-531ad6873bb6a5f3a752f5cd18ff0f0475df42f3.tar.xz wireguard-openbsd-531ad6873bb6a5f3a752f5cd18ff0f0475df42f3.zip |
always widen the imputed netmask if it is narrower than the specified octets.
fixes a strange behaviour where inet_net_pton would always return 4 (bits)
for multicast addresses no matter how many octets were specified.
negotiated with Paul Vixie, original author of this function.
ok millert@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/inet_net_pton.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/inet_net_pton.c b/lib/libc/net/inet_net_pton.c index 932531eb5d1..3c72efac6b7 100644 --- a/lib/libc/net/inet_net_pton.c +++ b/lib/libc/net/inet_net_pton.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet_net_pton.c,v 1.2 2002/02/17 19:42:23 millert Exp $ */ +/* $OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -21,7 +21,7 @@ #if 0 static const char rcsid[] = "$From: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $"; #else -static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.2 2002/02/17 19:42:23 millert Exp $"; +static const char rcsid[] = "$OpenBSD: inet_net_pton.c,v 1.3 2003/04/25 19:40:25 henning Exp $"; #endif #endif @@ -185,7 +185,7 @@ inet_net_pton_ipv4(src, dst, size) else /* Class A */ bits = 8; /* If imputed mask is narrower than specified octets, widen. */ - if (bits >= 8 && bits < ((dst - odst) * 8)) + if (bits < ((dst - odst) * 8)) bits = (dst - odst) * 8; } /* Extend network to cover the actual mask. */ |