Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 40951 invoked by uid 500); 26 Aug 2003 18:09:30 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 40837 invoked from network); 26 Aug 2003 18:09:27 -0000 Message-ID: <3F4B3CEE.5000707@attglobal.net> Date: Tue, 26 Aug 2003 06:56:46 -0400 From: Jeff Trawick Reply-To: trawick@attglobal.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: cvs commit: apr configure.in CHANGES References: <20030824230919.9071.qmail@minotaur.apache.org> <3F4A3C0F.3030104@attglobal.net> <37420000.1061830253@scotch.ics.uci.edu> <3F4A407E.1020304@attglobal.net> <20030825171305.GB2101@castlerea.stdlib.net.> <3F4A4D4B.80403@attglobal.net> <20030825234848.GA3708@castlerea.stdlib.net.> In-Reply-To: <20030825234848.GA3708@castlerea.stdlib.net.> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Colm MacCarthaigh wrote: >>>- rc = getnameinfo((struct sockaddr *)&sin6, sizeof sin6, hostbuf, >>>sizeof hostbuf, NULL, 0, NI_NAMEREQD); >>>+ rc = getnameinfo((struct sockaddr *)&sin, sizeof sin, hostbuf, sizeof >>>hostbuf, NULL, 0, 0); >>> printf("look up via IPv6: %d/%s\n", rc, hostbuf); > Hmmm, that doesnt make much sense. At the very least the different sin > size should be making it print an IPv4 address. Did you make both > sin6 -> sin changes on that line ? urr, I didn't have the getnameinfo() call patched properly :( my apologies :( with the patch properly applied the second getnameinfo() call works, which I suppose is intended to prove that when it didn't work we had the right data in the right place and it failed due to system library fubar > The one below, it fixes things for at least 3 Darwin using friends > of mine. > > Index: network_io/unix/sockaddr.c > =================================================================== > RCS file: /home/cvspublic/apr/network_io/unix/sockaddr.c,v > retrieving revision 1.41 > diff -u -r1.41 sockaddr.c > --- network_io/unix/sockaddr.c 14 Aug 2003 17:36:17 -0000 1.41 > +++ network_io/unix/sockaddr.c 14 Aug 2003 22:40:38 -0000 > @@ -634,9 +634,29 @@ > * a numeric address string if it fails to resolve the host name; > * that is *not* what we want here > */ > +#ifdef DARWIN && APR_HAVE_IPV6 > + /* Darwin's getnameinfo does not work for IPv4-mapped-IPv6 addresses, > + * the workaround is to convert the last 32 bits of the IPv6 address > + * to a valid sockaddr_in structure. This is extremely hacky, avoid > + * re-use. */ > + if (sockaddr->family == AF_INET6 && > + IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) { > + struct apr_sockaddr_t tmpsa; > + > + tmpsa.sa.sin.sin_family = AF_INET; > + tmpsa.sa.sin.sin_addr.s_addr = ((uint32_t *)sockaddr->ipaddr_ptr)[3]; > + > + rc = getnameinfo((const struct sockaddr *)&tmpsa.sa, > + sizeof(struct sockaddr_in), tmphostname, > + sizeof(tmphostname), NULL, 0, > + flags != 0 ? flags : NI_NAMEREQD); > + } > + else > +#endif > rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, > tmphostname, sizeof(tmphostname), NULL, 0, > flags != 0 ? flags : NI_NAMEREQD); > + > if (rc != 0) { > *hostname = NULL; Yeah, that looks reasonable :) I'm still curious about what was happening on Justin's system.