--- dhcp_189/c Tue Mar 03 20:37:14 2009 +++ dhcp/c Tue Mar 03 20:41:12 2009 @@ -83,6 +83,9 @@ #include "lwip/autoip.h" #include "lwip/dns.h" #include "netif/etharp.h" +#ifdef DHCP_GLOBAL_XID_HEADER +#include DHCP_GLOBAL_XID_HEADER /* include optional starting XID generation prototypes */ +#endif #include @@ -1323,6 +1326,21 @@ { struct dhcp *dhcp; u16_t i; +#ifndef DHCP_GLOBAL_XID + /** default global transaction identifier starting value (easy to match + * with a packet analyser). We simply increment for each new request. + * Predefine DHCP_GLOBAL_XID to a better value or a function call to generate one + * at runtime, any supporting function prototypes can be defined in DHCP_GLOBAL_XID_HEADER */ + static u32_t xid = 0xABCD0000; +#else + static u32_t xid; + static u8_t xid_initialised = 0; + + if (!xid_initialised) { + xid = DHCP_GLOBAL_XID; + xid_initialised = !xid_initialised; + } +#endif LWIP_ERROR("dhcp_create_request: netif != NULL", (netif != NULL), return ERR_ARG;); dhcp = netif->dhcp; LWIP_ERROR("dhcp_create_request: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);