From xaa@xaa.iae.nl Tue Sep  7 15:57:36 1999
Return-Path: <xaa@xaa.iae.nl>
Received: from esmeralda.xaa.iae.nl (esmeralda.xaa.iae.nl [194.151.75.9])
	by hub.freebsd.org (Postfix) with ESMTP id 1948514EE2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  7 Sep 1999 15:57:32 -0700 (PDT)
	(envelope-from xaa@xaa.iae.nl)
Received: from ariel.xaa.iae.nl (ariel.xaa.iae.nl [194.151.75.10])
	by esmeralda.xaa.iae.nl (Postfix) with ESMTP id 964B6BA1C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Sep 1999 00:55:46 +0200 (MET DST)
Received: by ariel.xaa.iae.nl (Postfix, from userid 1002)
	id 0895F1F4F; Wed,  8 Sep 1999 00:55:45 +0200 (CEST)
Message-Id: <19990907225545.0895F1F4F@ariel.xaa.iae.nl>
Date: Wed,  8 Sep 1999 00:55:45 +0200 (CEST)
From: xaa@xaa.iae.nl
Reply-To: xaa@xaa.iae.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: inet_aton accepts too much
X-Send-Pr-Version: 3.2

>Number:         13628
>Category:       bin
>Synopsis:       inet_aton doesn't check valid addresses well enough
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep  7 16:00:02 PDT 1999
>Closed-Date:    Thu Sep 9 09:18:39 PDT 1999
>Last-Modified:  Thu Sep  9 09:19:43 PDT 1999
>Originator:     Mark Huizer
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

4.0-current

>Description:

	inet_aton should return 0 on invalid IP addresses.
	1000.0.0.0 is an invalid address but inet_aton will kindly
	return 1000*(1<<24) and 1 for a successful translation

>How-To-Repeat:

	if (!inet_aton("1000.0.0.0",&sockaddress)) {
	    fprintf(stderr,"invalid address\n");
	} else
	    fprintf(stderr,"valid address??\n");

>Fix:
	
	check the parts more carefully.
	haven't checked linux' code yet, but that correctly returns a 0
	for invalid addresses


>Release-Note:
>Audit-Trail:

From: Bill Fenner <fenner@research.att.com>
To: xaa@xaa.iae.nl
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/13628: inet_aton accepts too much
Date: Wed, 8 Sep 1999 21:58:22 -0700

 Check out PR misc/10231 and http://www.freebsd.org/~adrian/inet_addr/ .
 Do they fix your problems?
 
   Bill
 
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Thu Sep 9 09:18:39 PDT 1999 
State-Changed-Why:  
misc/10231 reports the same problem; Adrian's solution addresses Mark's 
problem.  Now we just have to get the fix into the tree... 
>Unformatted:
