linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Martin Costabel <costabel@wanadoo.fr>
To: linuxppc-dev@lists.linuxppc.org
Cc: Tom Rini <tmrini@ntplx.net>
Subject: [BUG] in glibc-2.1.1-6b: gethostbyname broken
Date: Sat, 08 May 1999 14:20:59 +0200	[thread overview]
Message-ID: <37342C2B.E435F291@wanadoo.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]


Under glibc-2.1.1-6b, I cannot do an NFS-mount using the numeric IP
address of the server. Without even consulting the net, mount says:
  mount: can't get address for xx.xx.xx.xx

Under glibc-2.1.1-5b, it works correctly.

I tracked this down to gethostbyname, which doesn't work correctly when
fed a numeric IP address.

If I run the the attached program as
 tstgethbn 193.252.19.78 
I get a correct result when glibc-2.1.1-5b.ppc.rpm is installed, and an
error when glibc-2.1.1-6b.ppc.rpm is installed. Both rpms are from
mirror.linuxppc.org.

Could someone who knows what changed between 5b and 6b please look into
this?

Martin

[-- Attachment #2: tstgethbn.c --]
[-- Type: text/plain, Size: 890 bytes --]

/* tstgethbn.c
   Test for gesthostbyname */

#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
 
int main(int argc, char** argv)
{
   char hostname[65];
   struct hostent *he = NULL;
   struct hostent *he2 = NULL;
   extern int h_errno;
 
   strcpy(hostname, argv[1]);
   printf( " Looking up %s\n", hostname );
 
   he = gethostbyname(hostname);
   if ( h_errno ) {
       printf(" error %d\n", h_errno);
       herror(hostname);
   } 

   if ( he == NULL ){
       printf("No hostname found\n");
      exit(1);
   }

    printf( "\t      Hostname: %s\n", he->h_name );
 
   if ( he->h_addr_list[0] != NULL )
     printf("\t       Address: %s \n", 
	    inet_ntoa(*(struct in_addr *) he->h_addr_list[0]));

   he2 = gethostbyaddr( he->h_addr_list[0], he->h_length, he->h_addrtype );
   printf( "\t          Name: %s\n", he2->h_name );

   exit(0);
}
  

             reply	other threads:[~1999-05-08 12:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-08 12:20 Martin Costabel [this message]
1999-05-09 22:20 ` [BUG] in glibc-2.1.1-6b: gethostbyname broken Franz Sirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37342C2B.E435F291@wanadoo.fr \
    --to=costabel@wanadoo.fr \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=tmrini@ntplx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).