This is the mail archive of the libc-alpha@sourceware.cygnus.com 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]

Re: [PerSteinar.Iversen@adm.hioslo.no] libc/1331: gethostbyaddr vs. RFC 2317


I don't understand the problem.  I read the RFC and it explicitly
mentioned that it wouldn't require any changes in the lookup code.  So
if there are changes in the behaviour of programs using the lookup
functions the latter are at fault.

I also tried the function using the address you mentioned.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <netdb.h>
#include <arpa/inet.h>

int
main()
{
  char buf[100];
  char addr[4] = { 158, 36, 154, 34 };
  struct hostent *h = gethostbyaddr (addr, 4, AF_INET);
  if (h)
    printf ("name = %s\naddr = %s\n", h->h_name, 
            inet_net_ntop (AF_INET, h->h_addr, 32, buf, 100));
  else
    puts ("nothing found");

  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The result seems ok:

name = server.h-radet.hioslo.no
addr = 158.36.154.34/32


Also note the the `host' program does not use the NSS mechanism and
does its own resolving.  So a different behaviour here does not mean
anything.


If you still think there is a problem come up with a concrete and
reproducible example.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

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