This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: nscd and IPv6


On Tue, Jan 11, Philip Blundell wrote:

> I think this code in nscd/hstcache.c is bogus:
> 
>       /* And the generated IPv6 addresses if necessary.  */
>       if (hst->h_length == INADDRSZ)
> 	{
> 	  /* Generate the IPv6 addresses.  */
> 	  for (cnt = 0; cnt < h_addr_list_cnt; cp += IN6ADDRSZ, ++cnt)
> 	    map_v4v6_address (hst->h_addr_list[cnt], cp);
> 	}
> 
> IMHO, the NSS code should not be automatically mapping IPv4 addresses to IPv6,
> and it should certainly not be happening in nscd.  If a program wants both 
> IPv4 and IPv6 addresses it should pass PF_UNSPEC to getaddrinfo().
> 
> The current nscd behaviour is confusing to users (judging by the current 
> thread on libc-alpha and recent discussion elsewhere) and unhelpful on 
> IPv6-only hosts where a v4-mapped address is no use.
> 
> Does anybody object to deleting this code?

No. If it is wrong delete it. But ask Uli, he has written it. I think 
there is much more IPv6 code in the glibc which is bogus, for example 
in the NIS NSS modules. When I wrote the code I had copied it, but know
when learning more about IPv6 I think it is wrong, too.

One question about gethostbyname: If I use a hostname which has
only IPv6 addresses in /etc/hosts, this call always fails. Is
this correct ? 

And we use:
  if (_res.options & RES_USE_INET6)

When will _res.options be set ? And how can a user change this ?

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/       kukuk@suse.de
SuSE GmbH            Schanzaeckerstr. 10            90443 Nuernberg
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.

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