diff options
author | Bill Fenner <fenner@FreeBSD.org> | 2003-09-15 23:38:06 +0000 |
---|---|---|
committer | Bill Fenner <fenner@FreeBSD.org> | 2003-09-15 23:38:06 +0000 |
commit | 2b9de089a78f63a00ed886735324a70491e05e1c (patch) | |
tree | 946f1dc9a451c577397e7b3618ccf70386e1df0e /lib/libc/net/inet_net_pton.c | |
parent | 67193a54f0e243bff241fa039545b384026887cd (diff) | |
download | src-2b9de089a78f63a00ed886735324a70491e05e1c.tar.gz src-2b9de089a78f63a00ed886735324a70491e05e1c.zip |
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
Notes
Notes:
svn path=/head/; revision=120107
Diffstat (limited to 'lib/libc/net/inet_net_pton.c')
-rw-r--r-- | lib/libc/net/inet_net_pton.c | 2 |
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 85b05c67cd46..3a7145417663 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. */ |