On Fri, 2004-02-13 at 15:51 -0800, Stas Bekman wrote:
> Philippe M. Chiasson wrote:
> > On Thu, 2004-02-12 at 10:24 -0800, Stas Bekman wrote:
> > [...]
> > Configuring httpd with --enable-v4-mapped will make it all work, but
> > it's not the default, so most people on those BSDs are getting an httpd
> > that will default to IPv6. Even localhost in /etc/hosts is going to be
> > '::1' (ipv6 equiv of localhost).
> 
> So will the name->ip resolving function return ::1 then? in which case you get 
> the detection mechanism working, no?
> 
> on ipv4 we get:
> % perl -le 'use Socket; print inet_ntoa scalar gethostbyname shift;' localhost
> 
> 127.0.0.1
> 
> what do you get on ipv6?

127.0.0.1 ;-)

The problem in this case is that for backwards-compatibility, the
resolver library will return IPv4 address, unless (on OpenBSD) you use
gethostbyname2(...,AF_INET6), and I don't think Perl exposes that stuff
yet.

> > The following patch (short of being to detect at configure time the
> > IPv4/6 status of the box) hard-codes all the listening IP addresses to
> > 127.0.0.1, effectively ensuring all the test suite runs under vanilla-
> > IPv4.
> > 
> > Ideally, I'd like to figure out a way to detect things correctly, and
> > pick between 127.0.0.1 and ::1 accordingly.
> 
> What happens if localhost != 127.0.0.1? Shouldn't we use 'localhost' instead? 
> (though we know cases when users didn't have localhost defined in /etc/hosts)

Yeah, well, problems arises when localhost in /etc/hosts is ::1 (ipv6
loopback)

Ideally, to fix this once and for all, we need to determine 2 things:

1. The availability of IPv6 on that box
2. Wether httpd was compiled with --enable-v4-mapped or not (or what it
defaulted to)

And once we can figure that out, then can we make a correct decision as
to what to bind to.

But, AFAIK, 127.0.0.1 (or ::1) _must_ be the a loopback address, isn't
it ?
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to