hostnames resolving problem

Kelly Yancey kbyanc at posi.net
Sun Aug 31 18:52:14 PDT 2003


On 30 Aug 2003, Clemens Fischer wrote:

> * Kelly Yancey:
>
> > diff -u -p -r1.4.2.17 ipfw2.c
> > --- ipfw2.c	25 Jul 2003 08:23:07 -0000      1.4.2.17
> > +++ ipfw2.c	29 Aug 2003 19:14:33 -0000
> > @@ -1879,6 +1879,10 @@ lookup_host (char *host, struct in_addr
> >  		if ((he = gethostbyname(host)) == NULL)
> >  			return(-1);
> >  		*ipaddr = *(struct in_addr *)he->h_addr_list[0];
> > +		if (he->h_addr_list[1] != NULL) {
> > +			warn("%s resolved to multiple addresses, only using %s",
> > +			     host, inet_ntoa(*ipaddr));
> > +		}
>
> that would not be my cup of tea, because by this ipfw(8) becomes
> "unscriptable", ie. i'd have to grep(1) for messages and start from
> scratch again.  i guess this problem should be detected and handled
> ahead of running ipfw(8).  note that you can always use `-p
> preprocessor' for this.
>

  No you don't, it just warns, not exits.  You'll get warnings telling you
that what you are doing is a Bad Idea, but you can send them to /dev/null if
you don't care.

  Kelly

--
Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org}
FreeBSD, The Power To Serve: http://www.freebsd.org/



More information about the freebsd-ipfw mailing list