[466] in testers

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

netconfig does not call sethostid

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Dec 12 21:35:27 1989

From: epeisach@ATHENA.MIT.EDU
Date: Tue, 12 Dec 89 21:34:59 -0500
To: mar@ATHENA.MIT.EDU, probe@ATHENA.MIT.EDU
Cc: rel-eng@ATHENA.MIT.EDU, testers@ATHENA.MIT.EDU

It was discovered tonight that rvd servers would not work with 6.4A.
After plowing through the rvd code, I discovered the following:

1) Using ifconfig to get on the net works
2) Using netconfig doesn't.

Looking through the rvd server code, I discovered that 
	localhost.s_addr = gethostid();

Under ifconfig this is apparently the IP address, under netconfig this
is zero. (Some of the clients pickup the hostid via gethostid if set
or via gethostbyname if not, but not all, some bypass gethostid!).

The call was handled in the old /etc/rc.net by hostname. After loading
/etc/hosts with the IP address, it would read the file and set the
hostname and the hostid! (So much for incomplete man pages)

Therefore, as netconfig is handling the entry for /etc/hosts, it needs
to be modified that when invoked with th -h flag, it also calls
sethostid. 

I suggest the following patch to netconfig.c.

This change or one like it must go in soon. (I may be missing something
else in the rest of the code)

	Ezra

*** /tmp/,RCSt1016350	Tue Dec 12 21:33:41 1989
--- netconfig.c	Tue Dec 12 21:31:22 1989
***************
*** 372,379 ****
  
      writefile(CONFIGFILE, nip);
      enablenip(s, nip);
!     if (hflag)
        printf("%s\t%s\n", inet_ntoa(nip->ni_recommend), name);
  }
  
  
--- 372,381 ----
  
      writefile(CONFIGFILE, nip);
      enablenip(s, nip);
!     if (hflag) {
        printf("%s\t%s\n", inet_ntoa(nip->ni_recommend), name);
+       (void) sethostid(nip->ni_recommend);
+   }
  }
  
  

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