#1406 assigned defect

Invariant dhcp transaction ID can confuse dhcp state machine.

Reported by: Tim Cussins Owned by: Joel Sherrill
Priority: normal Milestone: 4.9.5
Component: network/legacy Version: 4.9
Severity: normal Keywords:
Cc: Blocked By:

Description (last modified by Gedare Bloom)

The dhcp code in rtems uses an unchanging transaction id (xid) in the dhcp discover and request packets.

It is possible (and in fact has been observed) that dhcp servers may issue multiple OFFER packets in response to multiple REQUEST packets from the same device.

The second OFFER packet could potentially be received while the dhcp state machine is waiting for an ACK packet - and this would cause the rtems dhcp process to fail needlessly.

A solution to this is to use the transaction id field (described in the bootp/dhcp protocols) to match server dhcp replies with rtems dhcp requests.

For details on the use of xid, see RFC 2131, Section 4.4.1 (http://www.networksorcery.com/enp/rfc/rfc2131.txt)

The patch creates a unique xid for each dhcp transaction: the DISCOVER/OFFER and REQUEST/ACK phases use different xid's, there is no confusion in the rtems state machine.

Attachments (2)

dhcp-unique-xid.diff (1.6 KB) - added by Tim Cussins on Apr 28, 2009 at 11:37:11 AM.
Patch guarantees a unique xid for each dhcp transation
0001-libnetworking-rtems_dhcp.c-Fix-invariant-DHCP-transa.patch (3.6 KB) - added by Aun-Ali Zaidi on Dec 28, 2015 at 6:23:56 PM.

Download all attachments as: .zip

Change History (6)

Changed on Apr 28, 2009 at 11:37:11 AM by Tim Cussins

Attachment: dhcp-unique-xid.diff added

Patch guarantees a unique xid for each dhcp transation

comment:1 Changed on Apr 28, 2009 at 11:43:24 AM by Tim Cussins

That last bit is slightly unclear, sorry.

As bootpc_call() checks the xid of the BOOTREPLY, using a new xid prevents packets related to the previous transaction (DISCOVER/OFFER) from being accepted by bootpc_call().

comment:2 Changed on Nov 22, 2014 at 1:36:35 PM by Gedare Bloom

Description: modified (diff)

comment:3 Changed on Nov 22, 2014 at 2:25:35 PM by Gedare Bloom

Owner: changed from Eric Norum to Joel Sherrill
Status: newassigned

comment:4 Changed on Dec 28, 2015 at 6:24:16 PM by Aun-Ali Zaidi

This is an updated patch.

Note: See TracTickets for help on using tickets.