[1413] in Kerberos
Re: Kerberos and two ethernet ports
daemon@ATHENA.MIT.EDU (Oleg Vishnepolsky)
Fri May 31 12:53:24 1991
Date: 31 May 91 13:00:21 GMT
From: oleg@watson.ibm.com (Oleg Vishnepolsky)
To: kerberos@shelby.Stanford.EDU
In <1991May24.210757.10215@shearson.com> viktor@shearson.com (Viktor Dukhovni) writes:
> galina@watson.ibm.com (Galina Kofman)_ writes:
>
> >In send_to_kdc.c after the socket was obtained add:
>
> > if ( loc_host_addr == 0 ) /* static u_long loc_host_addr = 0 initially */ {
> > if ( (loc_host_addr = gethostid()) == 0) {
> ^^^^^^^
> This is not terribly likely to return
> an IP address. On systems without a harware ID
> the default hostid may be based on the IP address,
> but these tend to also have sethostid(), which
> may be used by the sysadmin to set any other value.
>
>
> To bind to the primary address one must
>
> char name[MAXHOSTNAMELEN];
> struct hostent *hp;
> gethostname(name,MAXHOSTNAMELEN);
> if ( (hp=gethostbyname(name)) == NULL ) {
> /* error */
> ...
> }
> bcopy(hp->h_addr,&loc_host_addr,sizeof(loc_host_addr));
> --
> Viktor Dukhovni <viktor@shearson.com> : ARPA
> <...!uunet!shearson.com!viktor> : UUCP
> 388 Greenwich St., 11th floor, NY, NY 10013 : US-Post
> +1-(212)-464-3793 : VOICE
True on most UNIX systems. Not true on OS/2 and VM/CMS where Galina ported
KERBEROS to. gethostid() on these systems returns an IP address.
There gethostid() approach is more efficient since no need to resolve
a name is needed.
Oleg Vishnepolsky