summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2003-09-15 23:38:06 +0000
committerfenner <fenner@FreeBSD.org>2003-09-15 23:38:06 +0000
commitd41e114b7c3c0b87596120ca5d836779f05f428e (patch)
tree946f1dc9a451c577397e7b3618ccf70386e1df0e
parent0cbf0b4b66c815894b87af75e35f41791776f859 (diff)
downloadFreeBSD-src-d41e114b7c3c0b87596120ca5d836779f05f428e.zip
FreeBSD-src-d41e114b7c3c0b87596120ca5d836779f05f428e.tar.gz
From OpenBSD:
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. PR: standards/53151 Submitted by: Max Laier <max@love2party.net> Optained from: OpenBSD
-rw-r--r--lib/libc/net/inet_net_pton.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/net/inet_net_pton.c b/lib/libc/net/inet_net_pton.c
index 85b05c6..3a71454 100644
--- a/lib/libc/net/inet_net_pton.c
+++ b/lib/libc/net/inet_net_pton.c
@@ -186,7 +186,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. */
OpenPOWER on IntegriCloud