[comp.sys.isis] Another SUN OS problem....

ken@gvax.cs.cornell.edu (Ken Birman) (03/24/90)

I've seen the following problem on a fairly vanilla SUN system
recently.  SUN shipped the system with working binaries, but with
an incompatible copy of the name server that gethostbyname(3) talks to.
The problem is apparently that SUN is in some cases shipping a copy
of the name server that was compiled using an old copy of <netdb.h>.
gethostbyname works... but it doesn't return the right format of result.

A consequence is that ISIS couldn't look up the INET addresses of
the hosts in its sites file, and would either complain about 
bind failing in util/isis.c, or would come up but be "isolated"
from all other sites.

The fix I recommend is to recompile gethostbyname() from source and
link with the new version.  This apparently works... if you have source.

Ken

Here's a simple test program that you can use to see if your system
is set up right:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

main()
  {
        struct hostent *hep, *gethostbyname();
	char myname[128];
	gethostname(myname, 128);
	hep = gethostbyname(myname);
	printf("host %s: inet address %s\n", myname, inet_ntoa(hep->h_addr));
  }

A typical correct output is:
	host fafnir: inet address 128.84.254.216
to check that the inet address shown is indeed correct, 
	grep ifconfig /etc/rc.local
You would expect to see something like this:
	ifconfig ie0 broadcast 128.84.254.255
	ifconfig le0 broadcast 128.84.254.255
	ifconfig ec0 broadcast 128.84.254.255
	/usr/etc/route add default 128.84.254.227 1
Notice that fafnir's host address is used as an argument to ifconfig.

If the addresses come out wrong (i.e. half the fields are 0 or
they don't match) then your system has the same problem as the
National Cancer Research laboratory had.