apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Gillespie <...@pretzelnet.org>
Subject Re: IPv6 breakage on NetBSD
Date Tue, 03 Dec 2002 09:32:11 GMT
[CCing apr-dev because it looks like an apr problem.]

It looks like it might be a problem with revision 1.62 or apr
sockopt.c.  I'll be out of town all day today, but tomorrow if
no one has gotten to it i'll see if i can come up with a patch.

revision 1.62
date: 2002/11/13 23:47:29;  author: trawick;  state: Exp;  lines: +14 -0
add APR_IPV6_V6ONLY socket option
----------------------------
Index: sockopt.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/unix/sockopt.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -a -u -u -r1.61 -r1.62
--- sockopt.c	22 Oct 2002 20:05:35 -0000	1.61
+++ sockopt.c	13 Nov 2002 23:47:29 -0000	1.62
@@ -310,6 +310,20 @@
     if (opt & APR_INCOMPLETE_READ) {
         apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on);
     }
+    if (opt & APR_IPV6_V6ONLY) {
+#if APR_HAVE_IPV6 && defined(IPV6_V6ONLY)
+        /* we don't know the initial setting of this option,
+         * so don't check/set sock->netmask since that optimization
+         * won't work
+         */
+        if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY,
+                       (void *)&on, sizeof(int)) == -1) {
+            return errno;
+        }
+#else
+        return APR_ENOTIMPL;
+#endif
+    }
 
     return APR_SUCCESS; 
 }         


Original message for benefit of apr-dev:

Eric Gillespie <epg@pretzelnet.org> writes:

> I'm trying to update an Apache 2.0.43 system (which same system
> tracked HEAD from 2.0.16 up to the first GA, when i switched to
> tracking relelases) to the APACHE_2_0_BRANCH.  This is
> NetBSD/i386 1.6.  When i did the update it blew away apr and
> apr-util from the source tree because those directories don't
> have this branch, so i did a fresh HEAD checkout of those two in
> srclib.  The build went fine (with one minor problem with find
> usage documented in a separate message), but after install i have
> trouble starting httpd.
> 
> In httpd.conf i have:
> 
> Listen 0.0.0.0:80
> Listen [::]:80
> 
> In ssl.conf i have:
> 
> Listen 0.0.0.0:443
> Listen [::]:443
> 
> apachectl start gives the following error:
> 
> [Sun Dec 01 22:45:39 2002] [crit] (22)Invalid argument: make_sock: for addres
> s 0.0.0.0:443, apr_socket_opt_set: (IPV6_V6ONLY)
> no listening sockets available, shutting down
> Unable to open logs
> 
> I say, OK, i don't care about IPv6 anyway, i'll just kill the
> [::] lines.  But i still get the same error.
> 
> I notice that ssl-std.conf now has this:
> 
> # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
> #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
> #
> Listen 443
> 
> I don't know exactly what the comment is saying, but i don't
> care about IPv6 anyway so i just replace my ssl.conf Listen
> directives with that one.  Now i get this error:
> 
> [Sun Dec 01 22:49:28 2002] [crit] (22)Invalid argument: make_sock: for addres
> s 0.0.0.0:80, apr_socket_opt_set: (IPV6_V6ONLY)
> no listening sockets available, shutting down
> Unable to open logs
> 
> Grr.  Try killing the IPv6 listen line from httpd.conf, same
> error.  OK, let's look at httpd-std.conf:
> 
> # Change this to Listen on specific IP addresses as shown below to 
> # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
> #
> #Listen 12.34.56.78:80
> Listen 80
> 
> OK, it looks like plain old Listen 80 and Listen 443 are the new
> way of saying listen on all interfaces on these ports, so i make
> sure my httpd.conf and ssl.conf have those lines instead of my
> old lines and the server finally starts.
> 
> But, now it turns out it is listening on 80 and 443 *only* on
> 127.0.0.1 (verified with nmap and nc).
> 
> At this point i make clean and re-configure with
> --disable-ipv6.  Apache itself seems to have no "die ipv6 die"
> option, but apr disabled ipv6 like i asked.  Install this and
> try all the above scenarios again to get the exact same results.
> 
> So it looks like fatal breakage, whether generally or on NetBSD
> only, i don't know.
> 
> -- 
> Eric Gillespie, Jr. <*> epg@pretzelnet.org
> 
> Build a fire for a man, and he'll be warm for a day.  Set a man on
> fire, and he'll be warm for the rest of his life. -Terry Pratchett

--  
Eric Gillespie <*> epg@pretzelnet.org

Build a fire for a man, and he'll be warm for a day.  Set a man on
fire, and he'll be warm for the rest of his life. -Terry Pratchett

Mime
View raw message