public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: nscd and IPv6
       [not found] <phil@kings-cross.london.uk.eu.org>
@ 2000-01-11 13:02 ` Philip Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Blundell @ 2000-01-11 13:02 UTC (permalink / raw)
  To: Thorsten Kukuk; +Cc: libc-hacker

I wrote:

>use getaddrinfo or the new getipnodebyname call (which is a replacement for 
>gethostbyname2 and is not yet implemented in glibc as far as I know).  The 

Sorry, I was wrong; Uli implemented getipnodebyname some time ago by the looks 
of things.

p.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nscd and IPv6
  2000-01-11 12:44 ` Thorsten Kukuk
@ 2000-01-11 12:59   ` Philip Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Blundell @ 2000-01-11 12:59 UTC (permalink / raw)
  To: Thorsten Kukuk; +Cc: libc-hacker

>I think there is much more IPv6 code in the glibc which is bogus, for example 
>in the NIS NSS modules.

Very possibly.  Do point out anything you aren't sure about.  Now that 
distributions such as Debian are starting to work on IPv6 support this code 
will be exercised for the first time and it's likely there will be all sorts 
of bugs.  It doesn't help that the IPv6 API has been a moving target for the 
last few years.

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

Yes.  You should get back `No data associated with name' or something similar.
The reason is that this API provides no way for the caller to specify what 
sort of data it wants - old programs may fail if they are unexpectedly handed 
IPv6 addreses.  If you want to be able to receive IPv6 information you should 
use getaddrinfo or the new getipnodebyname call (which is a replacement for 
gethostbyname2 and is not yet implemented in glibc as far as I know).  The 
latter of these does allow you to request that v4 addresses should be mapped 
to v6 on a per-call basis.

>And we use:
>  if (_res.options & RES_USE_INET6)
>
>When will _res.options be set ? And how can a user change this ?

See RFC2133 for the gory details of this option.  It was intended that user 
applications would mess directly with _res.options.  Fortunately this is 
pretty much obsolete now and should almost certainly not be used.

p.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nscd and IPv6
  2000-01-11 12:02 Philip Blundell
@ 2000-01-11 12:44 ` Thorsten Kukuk
  2000-01-11 12:59   ` Philip Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Kukuk @ 2000-01-11 12:44 UTC (permalink / raw)
  To: Philip Blundell; +Cc: libc-hacker

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* nscd and IPv6
@ 2000-01-11 12:02 Philip Blundell
  2000-01-11 12:44 ` Thorsten Kukuk
  0 siblings, 1 reply; 4+ messages in thread
From: Philip Blundell @ 2000-01-11 12:02 UTC (permalink / raw)
  To: libc-hacker

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?

Thanks

p.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-01-11 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <phil@kings-cross.london.uk.eu.org>
2000-01-11 13:02 ` nscd and IPv6 Philip Blundell
2000-01-11 12:02 Philip Blundell
2000-01-11 12:44 ` Thorsten Kukuk
2000-01-11 12:59   ` Philip Blundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).