From owner-freebsd-apache@FreeBSD.ORG Wed May 25 19:16:50 2011 Return-Path: Delivered-To: freebsd-apache@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71A71065673 for ; Wed, 25 May 2011 19:16:50 +0000 (UTC) (envelope-from nick.rosier@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 870988FC17 for ; Wed, 25 May 2011 19:16:50 +0000 (UTC) Received: by vws18 with SMTP id 18so8295552vws.13 for ; Wed, 25 May 2011 12:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=i66EQQyxV1j2+JDxxz76l0WMrgLiKioMTBwuPOxT9UU=; b=kDP4fxl9jxXJIZdZGZLHqp6O4txSu6PO979O8/ISZFWTHEFm3obngIHoBGAYjIMrjo VXsR4kYwB6u25oZTiDK1eBF2xqxBHFXbpgwoCBIe9cgnBI9kZnqrnrQouGvxvd31gidN YOuuTVvx9fbbTF/SmqPrdDtbK7tsp3Rxou7Ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=apwh0uEZKCF+LbL5fZaRwvmmdyyYbsISSGS/6Gsv1zq8fOdCWxkv8voANn5x88131I H43OPrps7fGf4n4456ZN58FjUVYvgdPuANtBCV8X4OKRFnfhghlgUQEdmFA51v/sxUHG hNyNuNuU0NoVpzALUbriYK+Wtg3VmTs5vc/To= MIME-Version: 1.0 Received: by 10.221.12.201 with SMTP id pj9mr1580887vcb.172.1306351009672; Wed, 25 May 2011 12:16:49 -0700 (PDT) Received: by 10.220.185.201 with HTTP; Wed, 25 May 2011 12:16:49 -0700 (PDT) In-Reply-To: <20110525181709.GA45908@icarus.home.lan> References: <20110525181709.GA45908@icarus.home.lan> Date: Wed, 25 May 2011 21:16:49 +0200 Message-ID: From: Nick Rosier To: Jeremy Chadwick Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-apache@freebsd.org Subject: Re: IPv6 broken with Apache 2.2.19 X-BeenThere: freebsd-apache@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Support of apache-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 19:16:50 -0000 On 25 May 2011 20:17, Jeremy Chadwick wrote: > On Wed, May 25, 2011 at 05:21:42PM +0200, Nick Rosier wrote: >> Since the upgrade from Apache 2.2.17 to 2.2.19 I'm unable to get IPv6 >> to work; I keep getting following error: >> >> # grep Listen httpd.conf >> Listen x.x.x.x:80 >> Listen [2001:x:x:x:x::1]:80 >> >> # apachectl -t >> [Wed May 25 17:18:18 2011] [crit] (OS 1)Unknown host: alloc_listener: >> failed to set up sockaddr for [2001:x:x:x:x::1] >> Syntax error on line 41 of /usr/local/etc/apache22/httpd.conf: >> Listen setup failed >> >> Any ideas what I'm doing wrong? > > Assuming "OS 1" means errno 1 was returned, that's EPERM, which is > "Operation not permitted". =A0Assuming this is coming from socket(2), tha= t > correlates with: > > =A0[EPERM] =A0 =A0 =A0 =A0 =A0 =A0User has insufficient privileges to car= ry out the > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 requested operation. > > Do you have firewall rules or anything like that on this system? =A0Is th= e > network interface actually up/usable at this point? =A0Some Linux folks > have seen this problem (bug is still open): This instance runs in a Jail. I disabled pf but the problem persists. The interface is up and running (other services are binding to the IPv6 instance) without problems. > https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/397393 > > The Apache code in question which returns this error is in > server/listen.c. =A0The error check is on line 323, and puts focus on APR > not so much Apache (httpd): > > 311 =A0 =A0 =A0 =A0 status =3D apr_socket_create(&new->sd, new->bind_addr= ->family, > 312 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 SOCK_STREAM, 0, process->pool); > 313 > 314 #if APR_HAVE_IPV6 > 315 =A0 =A0 =A0 =A0 /* What could happen is that we got an IPv6 address, = but this system > 316 =A0 =A0 =A0 =A0 =A0* doesn't actually support IPv6. =A0Try the next a= ddress. > 317 =A0 =A0 =A0 =A0 =A0*/ > 318 =A0 =A0 =A0 =A0 if (status !=3D APR_SUCCESS && !addr && > 319 =A0 =A0 =A0 =A0 =A0 =A0 new->bind_addr->family =3D=3D APR_INET6) { > 320 =A0 =A0 =A0 =A0 =A0 =A0 continue; > 321 =A0 =A0 =A0 =A0 } > 322 #endif > 323 =A0 =A0 =A0 =A0 if (status !=3D APR_SUCCESS) { > 324 =A0 =A0 =A0 =A0 =A0 =A0 ap_log_perror(APLOG_MARK, APLOG_CRIT, status,= process->pool, > 325 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "alloc_listener: = failed to get a socket for %s", > 326 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr); > 327 =A0 =A0 =A0 =A0 =A0 =A0 return "Listen setup failed"; > 328 =A0 =A0 =A0 =A0 } > > The ChangeLog between Apache 2.2.17 and 2.2.19 indicates absolutely no > changes were made WRT IPv6 code, so again that puts focus on APR. > >> =A0# pkg_info | grep apr >> apr-ipv6-devrandom-gdbm-db42-1.4.5.1.3.12 Apache Portability Library > > The APR ChangeLog is filled with IPV6-related changes with 1.4.3, so the > question here is basically "what APR version were you using before you > upgraded"? > > http://www.apache.org/dist/apr/CHANGES-APR-1.4 > > apr_socket_create() for *IX is in network_io/unix/sockets.c around line > 91, so let's look via ViewVC to see who's touched things recently > (though we have no idea what timeframe we should be looking at, since we > don't know what APR version you were using before the upgrade): Based on my logs I came from APR 1.4.3. I first noticed the problems going to Apache 2.2.18 with APR 1.4.4. So I guess this started after upgrade from 1.4.3 to 1.4.4 > http://svn.apache.org/viewvc/apr/apr/tags/1.4.5/network_io/unix/sockets.c= ?view=3Dlog > > -- > | Jeremy Chadwick =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 jdc@parodius.com | > | Parodius Networking =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 http://= www.parodius.com/ | > | UNIX Systems Administrator =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Mountain = View, CA, USA | > | Making life hard for others since 1977. =A0 =A0 =A0 =A0 =A0 =A0 =A0 PGP= 4BD6C0CB | > >