[Top][All Lists]

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

Re: two machines gives same hostid

From: Bob Proulx
Subject: Re: two machines gives same hostid
Date: Wed, 30 Jan 2002 22:42:32 -0700

> I have two systems (Dell GX 240, RH 7.2 2.4.7-10 kernel). THe hostid
> output is same for both!


> system 1.
> Ethernet  HWaddr 00:06:5B:7C:32:EC
> hostid: 7f0100
> system 2:
> Ethernet  HWaddr  00:06:5B:7C:32:F3
> hostid: 7f0100
> How this can happen?

The hostid program calls the gethostid(2) kernel system call and
prints it out in hex format.  Literally:

  id = gethostid ();
  printf ("%lx\n", id);

The online standards documentation for gethostid() is here:


The important phrasing is:

  "The Open Group does not define the domain in which the return value
  is unique."

The man page for gethostid() says:

       Get or set a unique  32-bit  identifier  for  the  current
       machine.   The  32-bit identifier is intended to be unique
       among all UNIX systems in existence. This normally  resem-
       bles  the  Internet  address  for  the  local  machine, as
       returned by gethostbyname(3), and thus usually never needs
       to be set.

So presumably your two machines have the same IP address.  Since the
domain of uniqueness is not defined you could conceivably have two
machines with the same RFC unroutable address such as on
different networks.

Apparently the linux folks decided it was best to use the IP address
and it is valid for them to do so according to the standards.

In any case, there is nothing that sh-utils can do about it.  The
return value of gethostid(2) is a kernel function according to the


reply via email to

[Prev in Thread] Current Thread [Next in Thread]