Philippe M. Chiasson wrote:
On Thu, 2004-02-12 at 10:24 -0800, Stas Bekman wrote:

Andrew Wyllie wrote:


So, after rereading my previous post, I found one slight difference (funny how
it works that way sometimes). When I used telnet to connect to the server, it
used '::1' as an address for localhost as opposed to 127.0.0.1 . So I changed all the
refs to localhost in httpd.conf to ::1 and sure enough, all the tests passed. I'm going to look
into this a bit more to see why this is the case as I have always thought that both of these
cases should work the same way.

So how can we make it into a setup that will work on both, ipv6 and ipv4?


The problem is that on most BSDs, IPv6 is starting to become the default
setup, at least, it's the case on my OpenBSD box.

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?

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)


__________________________________________________________________
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

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to