[ipxe-devel] [PATCH] [dhcp] Use random transaction ID to associate messages

Eduardo Habkost ehabkost at redhat.com
Thu Sep 15 18:09:28 UTC 2011


On Thu, Sep 15, 2011 at 05:53:02PM +0300, Sasha Levin wrote:
[...]
> The 'random xid' suggestion is listed merely as an example.
> 
> The way I see it using a xid based on MAC instead of a random number is
> safer since the odds for same MAC on the same network are pretty slim
> since it would cause problems on other layers in the network.

I would agree with you if the current code didn't use just the last 4
bytes of the MAC address. So clients could have completely different MAC
addresses (as expected), have no problems communicating in the network,
but share the same final 4 bytes in the MAC address and end up
generating the same xid.

Probably a hash function that used all bytes of the MAC address as input
would work too, but using a random number seems to be good enough (and
simpler, IMO).


> 
> Whats the reason behind this patch? Whats wrong with current selection
> of xid?

I'm not sure what issue made Amos investigate the xid generation code,
but the current selection of xid is wrong as it uses just the last 4
bytes of the MAC address.

-- 
Eduardo



More information about the ipxe-devel mailing list