This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/4] getaddrinfo: Remove unnecessary variables and code


On Wed, Dec 11, 2013 at 08:06:27AM -0500, Pavel Simerda wrote:
> ----- Original Message -----
> > From: "Pavel Simerda" <psimerda@redhat.com>
> > To: "OndÅej BÃlka" <neleai@seznam.cz>
> > Cc: "libc-alpha" <libc-alpha@sourceware.org>, "Siddhesh Poyarekar" <siddhesh@redhat.com>
> > Sent: Monday, December 9, 2013 7:22:36 PM
> > Subject: Re: [PATCH 1/4] getaddrinfo: Remove unnecessary variables and code
> > 
> > ----- Original Message -----
> > > From: "OndÅej BÃlka" <neleai@seznam.cz>
> > > To: "Pavel Simerda" <psimerda@redhat.com>
> > > Cc: "libc-alpha" <libc-alpha@sourceware.org>, "Siddhesh Poyarekar"
> > > <siddhesh@redhat.com>
> > > Sent: Monday, December 9, 2013 4:27:10 PM
> > > Subject: Re: [PATCH 1/4] getaddrinfo: Remove unnecessary variables and code
> > > 
> > > On Mon, Dec 09, 2013 at 08:37:18AM -0500, Pavel Simerda wrote:
> > > > Variable 'end' in getaddrinfo() was only used to compute 'nresults'
> > > > which was already computed in gaih_inet() and stored in 'naddrs'.
> > > >
> > > This needs know code in detail, it looks similir but I there is
> > > following fragment that may mak these differ
> > > 
> > >  /* If we looked up IPv4 mapped address discard them here if
> > >                the caller isn't interested in all address and we have
> > >                found at least one IPv6 address.  */
> > >             if (got_ipv6
> > >                 && (req->ai_flags & (AI_V4MAPPED|AI_ALL)) == AI_V4MAPPED
> > >                 && IN6_IS_ADDR_V4MAPPED (at2->addr))
> > >               goto ignore;
> > 
> > Looking at it once again. This code is only preceeded by canonical name
> > handling without struct addrinfo allocation. Therefore the goto not only
> > results in skipping the incrementation, but also skipping the addrinfo list
> > append action which is a couple of lines below the goto command. Looks safe
> > to me.
> 
> So, if we could get a positive review for this, the first patch is ready for inclusion (and so is the second one).
> 
> Pavel
>
I tried to include but when I ran 'make check' I got

env GCONV_PATH=/aux/ondra/test4/iconvdata LC_ALL=C
/aux/ondra/test4/elf/ld-linux-x86-64.so.2 --library-path
/aux/ondra/test4:/aux/ondra/test4/math:/aux/ondra/test4/elf:/aux/ondra/test4/dlfcn:/aux/ondra/test4/nss:/aux/ondra/test4/nis:/aux/ondra/test4/rt:/aux/ondra/test4/resolv:/aux/ondra/test4/crypt:/aux/ondra/test4/nptl
/aux/ondra/test4/posix/tst-getaddrinfo4  >
/aux/ondra/test4/posix/tst-getaddrinfo4.out
Didn't expect signal from child: got `Segmentation fault'
make[2]: *** [/aux/ondra/test4/posix/tst-getaddrinfo4.out] Error 1

There is warning about type as nresults is int but gaih_inet expects
unsigned int.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]