From c51e6fbb125c1102d2761d802356ed11c319b0ab Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 31 Jul 2017 20:20:31 +0200 Subject: [PATCH] Fixed bug #51623: DHCP request XID should probably be regenerated for INIT-REBOOT (cherry picked from commit a81b19aa62a326aa93bc43d5e9ffb78e4bdde20b) --- src/core/ipv4/dhcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index 388e48af..0cf97b03 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -736,7 +736,7 @@ dhcp_start(struct netif *netif) /* no DHCP client attached yet? */ if (dhcp == NULL) { - LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting new DHCP client\n")); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): mallocing new DHCP client\n")); dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp)); if (dhcp == NULL) { LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n")); @@ -1832,7 +1832,7 @@ dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type) (dhcp->p_out->len >= sizeof(struct dhcp_msg))); /* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */ - if (message_type != DHCP_REQUEST) { + if ((message_type != DHCP_REQUEST) || (dhcp->state == DHCP_STATE_REBOOTING)) { /* reuse transaction identifier in retransmissions */ if (dhcp->tries == 0) { #if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)