[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DHCP Transaction ID
- Date: Tue, 21 Apr 2009 16:58:30 +0100
- From: timcussins at eml.cc (Tim Cussins)
- Subject: DHCP Transaction ID
On Tue, 21 Apr 2009 07:41 -0700, "Chris Ford" <chris at island2.com> wrote:
> On Tue, Apr 21, 2009 at 2:48 AM, Tim Cussins <timcussins at eml.cc> wrote:
> > (2) use a unique transaction id for each exchange.
> > ...
> > My proposed patch updates the xid field using rand() in both
> > dhcp_discover_req() and dhcp_request_req(). This means a new xid for
> > each exchange.
> Here is one of the places that the patch calls rand():
> - (*xid)++;
> - call->xid = htonl (*xid);
> + call->xid = htonl(rand());
> It looks like htonl(rand()) could return the same ID that was used in
> the previous exchange. That is, uniqueness is not guaranteed.
> If rand() is to be used, consider using it to generate a nonzero
> offset to the previous ID.
Outstanding catch - thanks mate.