From d41e114b7c3c0b87596120ca5d836779f05f428e Mon Sep 17 00:00:00 2001 From: fenner Date: Mon, 15 Sep 2003 23:38:06 +0000 Subject: 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 Optained from: OpenBSD --- lib/libc/net/inet_net_pton.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/net') 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. */ -- cgit v1.1