standards/53151: inet_net_pton() returns 4 for *all* multicast hosts!

Max Laier max at love2party.net
Tue Jun 10 09:30:06 PDT 2003


>Number:         53151
>Category:       standards
>Synopsis:       inet_net_pton() returns 4 for *all* multicast hosts!
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 10 09:30:03 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Max Laier
>Release:        FreeBSD 5.0-RELEASE-p7 i386
>Organization:
>Environment:
System: FreeBSD router.laiers.local 5.0-RELEASE-p7 FreeBSD 5.0-RELEASE-p7 #0: Mon Apr 14 13:13:41 CEST 2003 root at router.laiers.local:/usr/src/sys/i386/compile/MAX_SMP i386


	
>Description:
See http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/net/inet_net_pton.c
for the original issue and fix. It mentions "negotiated with Paul Vixie, 
original author of this function." so there might be a fix in the original
bind sources by now!

>How-To-Repeat:
Use inet_net_pton() to get info about a multicast host will
return 4. e.g.:
inet_net_pton(AF_INET, "224.4.5.4", &dst, sizeof(dst)) should return 32 as
all 4 byte are given i.e. we talk about 224.4.5.4/32 not about 224.0.0.0/4!

>Fix:
Use the attached pacht against "src/contrib/bind/lib/inet/inet_net_pton.c" 
(or resync with offical bind dist?)
	

--- inet_net_pton.c.patch begins here ---
--- inet_net_pton.c.orig	Tue Jun 10 17:01:18 2003
+++ inet_net_pton.c	Tue Jun 10 17:02:00 2003
@@ -160,7 +160,7 @@
 		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. */
--- inet_net_pton.c.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-standards mailing list