On 14 Nov 2002 14:17:11 -0000, [EMAIL PROTECTED] wrote:
> trawick 2002/11/14 06:17:11
>
> Modified: . CHANGES acinclude.m4 configure.in
> docs/conf httpd-std.conf.in ssl-std.conf
> server listen.c
> Log:
> Add --[enable|disable]-v4-mapped configure option to control
> whether or not Apache expects to handle IPv4 connections
> on IPv6 listening sockets. Either setting will work on
> systems with the IPV6_V6ONLY socket option. --enable-v4-mapped
> must be used on systems that always allow IPv4 connections on
> IPv6 listening sockets.
after this commit, httpd cannot run with following error;
[Fri Nov 22 20:01:43 2002] [crit] (22)Invalid argument: make_sock: for address
127.0.0.1:80, apr_socket_opt_set: (IPV6_V6ONLY)
no listening sockets available, shutting down
Unable to open logs
on my FreeBSD boxes, both -current and -stable with ipv4-mapping
disabled and enabled respectively.
i think this error occurs because IPV6_V6ONLY option are being set
on all sockets; even if on the IPv4 sockets.
following is a patch to set IPV6_V6ONLY option on only IPv6 sockets.
i don't know if this is a correct answer but it solves at least my problem...
Regards,
hiro hanai
-----------------------------------------------------------------------------
Index: listen.c
===================================================================
RCS file: /fs/pub/cvs/Apache/httpd-2.0/server/listen.c,v
retrieving revision 1.83
diff -u -r1.83 listen.c
--- listen.c 14 Nov 2002 14:17:11 -0000 1.83
+++ listen.c 22 Nov 2002 09:52:45 -0000
@@ -118,14 +118,16 @@
}
#if APR_HAVE_IPV6
- stat = apr_socket_opt_set(s, APR_IPV6_V6ONLY, v6only_setting);
- if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
+ if (server->bind_addr->family == AF_INET6) {
+ stat = apr_socket_opt_set(s, APR_IPV6_V6ONLY, v6only_setting);
+ if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p,
"make_sock: for address %pI, apr_socket_opt_set: "
"(IPV6_V6ONLY)",
server->bind_addr);
apr_socket_close(s);
return stat;
+ }
}
#endif
-----------------------------------------------------------------------------