From owner-freebsd-bugs Sat Nov 15 11:20:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA26255 for bugs-outgoing; Sat, 15 Nov 1997 11:20:24 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: from catarina.usc.edu (catarina.usc.edu [128.125.51.47]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id LAA26181; Sat, 15 Nov 1997 11:19:56 -0800 (PST) (envelope-from pavlin@catarina.usc.edu) Received: from excalibur.usc.edu (excalibur.usc.edu [128.125.51.11]) by catarina.usc.edu (8.6.10/8.6.9) with SMTP id LAA04969; Sat, 15 Nov 1997 11:19:54 -0800 Message-Id: <199711151919.LAA04969@catarina.usc.edu> X-Authentication-Warning: catarina.usc.edu: Host excalibur.usc.edu didn't use HELO protocol To: FreeBSD-gnats@freebsd.org, freebsd-bugs@freebsd.org cc: pavlin@catarina.usc.edu Subject: Re: bin/5047: ipfw(8) IP address resolving problem if only /etc/hosts used In-reply-to: Your message of "Fri, 14 Nov 1997 20:30:01 PST." <199711150430.UAA28818@hub.freebsd.org> Date: Sat, 15 Nov 1997 11:19:53 -0800 From: Pavlin Ivanov Radoslavov Sender: owner-freebsd-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Thank you very much for your problem report. > It has the internal identification `bin/5047'. > The individual assigned to look at your > report is: freebsd-bugs. > > >Category: bin > >Responsible: freebsd-bugs > >Synopsis: ipfw(8) IP address resolving problem if only /etc/hosts used > >Arrival-Date: Fri Nov 14 20:30:00 PST 1997 Below is a better fix of the problem. It allows any IP address to be given as an input instead of allowing only the addresses that can be resolved: --- ipfw.c Wed Mar 5 04:30:08 1997 +++ ipfw-new.c Sat Nov 15 11:10:58 1997 @@ -386,8 +386,16 @@ { struct hostent *he = gethostbyname(host); - if (!he) - return(-1); + if (!he) { + struct in_addr ia; + + if (!inet_aton(host, &ia)) + return(-1); + else { + *ipaddr = ia; + return(0); + } + } *ipaddr = *(struct in_addr *)he->h_addr_list[0];