Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!bywater!arnor!news From: oleg@watson.ibm.com (Oleg Vishnepolsky) Newsgroups: comp.protocols.kerberos Subject: Re: Kerberos and two ethernet ports Message-ID: <1991May31.130021.29884@watson.ibm.com> Date: 31 May 91 13:00:21 GMT Sender: news@watson.ibm.com (NNTP News Poster) Organization: IBM T.J. Watson Research Center Lines: 37 Nntp-Posting-Host: oleg 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 : 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