mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-25 17:46:56 +08:00
fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
This commit is contained in:
@@ -1671,15 +1671,18 @@ dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
|
||||
LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg",
|
||||
(dhcp->p_out->len >= sizeof(struct dhcp_msg)));
|
||||
|
||||
/* reuse transaction identifier in retransmissions */
|
||||
if (dhcp->tries == 0) {
|
||||
/* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */
|
||||
if (message_type != DHCP_REQUEST) {
|
||||
/* reuse transaction identifier in retransmissions */
|
||||
if (dhcp->tries == 0) {
|
||||
#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
|
||||
xid = LWIP_RAND();
|
||||
xid = LWIP_RAND();
|
||||
#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
||||
xid++;
|
||||
xid++;
|
||||
#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
||||
}
|
||||
dhcp->xid = xid;
|
||||
}
|
||||
dhcp->xid = xid;
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
|
||||
("transaction id xid(%"X32_F")\n", xid));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user