Author Topic: skipping incomming chaddr causes multi-device system to fail dhcp  (Read 4239 times)

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile

We found an issue under the following circumstances:
1) Using the software random sequence generator (as opposed to a hardware PRNG).
2) Multiple devices powering up at the same time on the same network, including the router (think power outage).

When this happens all the devices are asking for DHCP at around the same time using an identical XID.  Thus multiple devices get the same IP address.

It appears that in fnDHCPListner()
Code: [Select]
data += IPV4_LENGTH + 216;  // skip siaddr, chaddr, sname, file and get all info from the options fieldthe chaddr isn't being checked against the devices own MAC.

Is there any particular reason to not do this comparison?  We are routinely getting two to five devices installed per location (yay for our side), and have seen this behavior several times.


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3216
    • View Profile
    • uTasker
Re: skipping incomming chaddr causes multi-device system to fail dhcp
« Reply #1 on: November 24, 2010, 11:17:17 PM »
Hi Aaron

That is a problem that can indeed result when a number of devices are started together which use the same random number seed. The check of the MAC address has been added recently to aid in this situation.

The latest code is attached - note that it also includes a few additional improvements as documented in the header. Although quite rare, these can also help in particular situations:

   22.03.2010   Verify the MAC address in offers to ensure accepting only own values {4}
   03.06.2010   Correct MAX_TIMER_DELAY value                            {5}
   04.06.2010   Check for invalid renewal and rebind timers from server and force realistic values {6}
   24.10.2010   Add relay agent support                                  {7}