[622] in RedHat Linux List

home help back first fref pref prev next nref lref last post

gethostbyaddr and NIS on Red Hat 4.0

daemon@ATHENA.MIT.EDU (Miguel de Icaza)
Wed Oct 23 17:23:29 1996

To: redhat-list@redhat.com
From: Miguel de Icaza <miguel@nuclecu.unam.mx>
Date: 23 Oct 1996 16:10:29 -0500
In-Reply-To: Erik Troan's message of Wed, 23 Oct 1996 12:16:48 -0400 (EDT)
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


I have included a small test program that shows the problem with
gethostbyaddr on Red Hat 4.0 if the file /etc/yp.conf has a valid NIS
server configured.

The output of this program should be:

hostent: tirania.nuclecu.unam.mx

Best wishes,
Miguel.

#include <endian.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

main ()
{
   struct hostent *he;
   unsigned int a;

   if (BYTE_ORDER == LITTLE_ENDIAN)
       a = 0xc81df884;
   else
       a = 0x84f81dc8;

   he = gethostbyaddr (&a, 4, AF_INET);
   if (!he){
      printf ("your name server is not working, that query ought to work\n");
   }
   printf ("hostent: %s\n", he->h_name);
}


--
  PLEASE read the Red Hat FAQ, Tips, HOWTO and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-HOWTO 
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post