httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Carlson <jcarl...@jnous.com>
Subject Re: [PATCH] IPV6 enabled check on Solaris
Date Thu, 24 Apr 2003 21:44:37 GMT
Jeff Trawick wrote:
 > what about something like this?
 >
 > const char *local_ipv6_addrs[] = "::1", "::", "localhost";
 >
 > for (cur = 0; cur < numaddrs; cur++) {
 >     rv = try_addr(local_ipv6_addrs[cur]);
 >     if rv is APR_SUCCESS
 >       break;
 > }
 >

I have to admit, I'm not that familiar with how IPv6 works.  After reading your 
post, I hit the books, and learned that ::1 is the new loopback.  Since this is 
what I was after by using localhost, can we just go with that?  After creating a 
socket on INADDR_ANY (::), we should be pretty much guaranteed to connect to it 
thru ::1 (if IPv6 is really turned on).  And if we can't connect to ::1, it 
seems unlikely that Apache has any business listening on an IPv6 port.  Perhaps 
trying all three addresses, as given above, is overkill.  But like I say, I 
don't have much experience here, so I'm just spitballing.

I do have one more comment below...

> for try_addr() to work:
> 
> must be able to get socket
> must be able to bind to ephemeral port
> must be able to listen
> must be able to get second socket
> must be able to connect second socket to first socket using address 
> passed in by find_family()

On that last point, do you mean "must be able to connect second socket to first 
socket using address passed in by try_addr()"?  The user didn't give us a 
hostname to try, which is the point of find_default_family().

Thanks,

Jim


Mime
View raw message