This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: DHCP server xid
Robin Farine wrote:
> And about the XID? IMHO, always using the same XID may result in cases
> where the client will mix requests and replies, otherwise the protocol
> wouldn't define an XID after all.
Right, but in practice, this shouldn't be a problem. dhcp_prot.c checks
whether the message type of the DHCP reply it received makes sense in
the current state and just discards it if not. So to cause problems,
you'd have to receive a retransmit of a really old reply that happens to
make sense in the current state.
> If the client would keep the same XID
> until it gets a reply (while respecting the exponential increase in the
> delays until it reaches the limit of 64 seconds) and increment the XID
> for each reply, wouldn't that solve the problem you observed with the
> DHCPDISCOVER packets on plc1g?
You just have to make sure that you change the XID only if you *accept*
the reply (i.e. the reply causes a state change to the "next" state in
the DHCP state machine). There are a few places in dhcp_prot.c where a
recv() is done and they all would have to be changed.
But the changes are trivial, so why not do it right if it's so easy to
do? Unfortunately, I don't have time at the moment to implement/test
them... :-(
Martin