Date: Sun, 12 Aug 2012 19:53:24 -0400 From: Curtis Villamizar <curtis@occnc.com> To: "apache@FreeBSD.org" <apache@FreeBSD.org> Cc: curtis@occnc.com Subject: Re: patch to apache for IPv6 only httpd Message-ID: <201208122353.q7CNrOji075223@gateway.ipv6.occnc.com> In-Reply-To: Your message of "Mon, 13 Aug 2012 00:25:28 %2B0200." <50282D58.5070605@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <50282D58.5070605@FreeBSD.org> Olli Hauer writes: > On 2012-08-11 23:22, Curtis Villamizar wrote: > > FYI- > > > > This very simple patch prevents an assert when httpd is run on a > > server that has no IPv4 address. An example is a BSD jail running > > with only an IPv6 address on the interface (no loopback so no > > 127.0.0.1 address to bind to). > > > > Copy the patch below into the files directory as > > /usr/ports/www/apache22/files/patch-server__config.c > > > > The port maintainer is on the Cc. No bug has been reported. > > > > BTW- I noticed this a long time ago. I don't remember if I reported > > it or forgot to. Appologies if this is a duplicate. It is not in the > > httpd-2.2.22.tar.bz2 tarball, in the distinfo dated 23 July 2012. > > > > Curtis > > > > > > --- ./server/config.c.orig 2010-10-07 09:56:54.000000000 -0700 > > +++ ./server/config.c 2011-09-26 21:20:35.000000000 -0700 > > @@ -1979,6 +1979,9 @@ > > /* NOT virtual host; don't match any real network interface */ > > rv = apr_sockaddr_info_get(&s->addrs->host_addr, > > NULL, APR_INET, 0, 0, p); > > + if (rv != APR_SUCCESS) > > + rv = apr_sockaddr_info_get(&s->addrs->host_addr, > > + NULL, APR_UNSPEC, 0, 0, p); > > ap_assert(rv == APR_SUCCESS); /* otherwise: bug or no storage */ > > > > s->addrs->host_port = 0; /* matches any port */ > > Hi Curtis, > > Is this patch also relevant if apache22 was build with > -DWITH_IPV6_V6ONLY ? > > -- > olli No. Apache was not built with -DWITH_IPV6_V6ONLY. It is apache built with dual stack support though I don't think the code is any different if built with WITH_IPV6_V6ONLY. Nothing here is conditionally compiled. I also checked the .h where APR_INET is defined (in srclib/apr/include/apr_network_io.h). It is unconditionally defined to AF_INET. The code compiles but the server fails to run, giving an assert when starting up. Its a simple patch. APR_INET6 could be used instead of APR_UNSPEC in the patch. Curtis
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208122353.q7CNrOji075223>