summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2011-09-19 18:30:39 +0200
committerMichael Brown2011-09-19 18:35:42 +0200
commit12767d2202e620e32aef3fbdd2c4ad30c4e5ac22 (patch)
treeb10f28229de9af32f3b7302f0b63b5fd76c6f694 /src/include
parent[util] Add romcheck.pl (diff)
downloadipxe-12767d2202e620e32aef3fbdd2c4ad30c4e5ac22.tar.gz
ipxe-12767d2202e620e32aef3fbdd2c4ad30c4e5ac22.tar.xz
ipxe-12767d2202e620e32aef3fbdd2c4ad30c4e5ac22.zip
[dhcp] Use a random DHCP transaction identifier (xid)
iPXE currently uses the last four bytes of the MAC address as the DHCP transaction identifier. Reduce the probability of collisions by generating a random transaction identifier. Originally-implemented-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/dhcp.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/ipxe/dhcp.h b/src/include/ipxe/dhcp.h
index dbca8e633..06fb33bc0 100644
--- a/src/include/ipxe/dhcp.h
+++ b/src/include/ipxe/dhcp.h
@@ -660,15 +660,18 @@ struct dhcphdr {
/** Setting block name used for BootServerDHCP responses */
#define PXEBS_SETTINGS_NAME "pxebs"
+extern uint32_t dhcp_last_xid;
extern unsigned int dhcp_chaddr ( struct net_device *netdev, void *chaddr,
uint16_t *flags );
extern int dhcp_create_packet ( struct dhcp_packet *dhcppkt,
struct net_device *netdev, uint8_t msgtype,
- const void *options, size_t options_len,
- void *data, size_t max_len );
+ uint32_t xid, const void *options,
+ size_t options_len, void *data,
+ size_t max_len );
extern int dhcp_create_request ( struct dhcp_packet *dhcppkt,
struct net_device *netdev,
- unsigned int msgtype, struct in_addr ciaddr,
+ unsigned int msgtype, uint32_t xid,
+ struct in_addr ciaddr,
void *data, size_t max_len );
extern int start_dhcp ( struct interface *job, struct net_device *netdev );
extern int start_pxebs ( struct interface *job, struct net_device *netdev,