RE: ORBit without DNS?



Hi

This is my ior-decode output:

--------------------------------------
Tags known:
TAG_INTERNET_IOP: 0x0
TAG_MULTIPLE_COMPONENTS: 0x1
TAG_ORBIT_SPECIFIC: 0xbadfaeca

Object ID: IDL:Name/NameServer:1.0
Profile count: 2

Profile type: TAG_ORBIT_SPECIFIC
Object endian: Little
IIOP version: 1.0
Socket path: /tmp/orbit-root/orb-19846032311201307366
IPv6 port: 0
Object key: ".....,.....n.......2.n.<"

Profile type: TAG_INTERNET_IOP
Object endian: Little
IIOP version: 1.0
Host: 200.2.1.40
Port: 1028
Object key: ".....,.....n.......2.n.<"
-----------------------------------------------------------

However, I think this is the problem:
src/IIOP/connection.c - iiop_connection_server() uses gethostname() &
gethostbyname() to get the host details. If hostname contains a '.' then
the hostname is used as it is. Otherwise gethostbyname() is called to get
the IP Address.

This is the code snippet from connection.c:
....
gethostname(hn_tmp, sizeof(hn_tmp) - 1);
  hent = gethostbyname(hn_tmp);
  if(hent)
    {
      if (strchr (hent->h_name, '.'))
  server_cnx->u.ipv4.hostname = g_strdup(hent->h_name);
      else
  {
    struct in_addr * addr = (struct in_addr *) hent->h_addr_list[0];
    g_assert (hent->h_length == sizeof (struct in_addr) && addr);
    server_cnx->u.ipv4.hostname = g_strdup (inet_ntoa (*addr));
  }
    }
  else
    server_cnx->u.ipv4.hostname = g_strdup(hn_tmp);
....


Try to rename your official hostname to be w/o a '.'. Eg change your
/etc/hosts as <IP Address> testhost, if you are using /etc/hosts. Run your
server again & run ior-decode on the ior file.
I just went through the source code & found out this. Other people on the
list may be able to throw more light.

Sreeji


>....
>  I just did this and it says:
> Host: xxx.narus.com
> 
> instead of the IP address.
> 
> -Sean
> 
> -----Original Message-----
> From: Sreeji K Das
> To: 'orbit-list@gnome.org'
> Sent: 7/24/01 9:58 PM
> Subject: Re: ORBit without DNS?
> 
> Hi
> I don't think ORBit embeds the name of the machine in the IOR (or for
> that
> matter any ORB). To check, do 'ior-decode `cat iorfile`' and see the
> output.
> 
> Sreeji
> 
> On Tue, 24 Jul 2001, Sean McCauliff wrote:
> 
> > I have a system which does not use DNS and I do not want to sync
> /etc/hosts
> > across machines (DNS before DNS).  Is there a way to tell ORBit to
> embed the
> > IP address of the machine and not the name of the machine in the IOR?
> > 
> > Thanks,
> > -Sean
> > 
> > 
> > _______________________________________________
> > orbit-list mailing list
> > orbit-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/orbit-list
> > 
> 
> 
> _______________________________________________
> orbit-list mailing list
> orbit-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/orbit-list
> 









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]