mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 04:12:07 +00:00
fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
This commit is contained in:
parent
d9d0c52770
commit
c82f04f54c
@ -96,6 +96,9 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2014-02-27: Simon Goldschmidt
|
||||||
|
* dhcp.c: fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
|
||||||
|
|
||||||
2014-02-27: Simon Goldschmidt
|
2014-02-27: Simon Goldschmidt
|
||||||
* raw.c: fixed bug #41680 raw socket can not receive IPv6 packet when
|
* raw.c: fixed bug #41680 raw socket can not receive IPv6 packet when
|
||||||
IP_SOF_BROADCAST_RECV==1
|
IP_SOF_BROADCAST_RECV==1
|
||||||
|
@ -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",
|
LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg",
|
||||||
(dhcp->p_out->len >= sizeof(struct dhcp_msg)));
|
(dhcp->p_out->len >= sizeof(struct dhcp_msg)));
|
||||||
|
|
||||||
/* reuse transaction identifier in retransmissions */
|
/* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */
|
||||||
if (dhcp->tries == 0) {
|
if (message_type != DHCP_REQUEST) {
|
||||||
|
/* reuse transaction identifier in retransmissions */
|
||||||
|
if (dhcp->tries == 0) {
|
||||||
#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
|
#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
|
||||||
xid = LWIP_RAND();
|
xid = LWIP_RAND();
|
||||||
#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
||||||
xid++;
|
xid++;
|
||||||
#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
|
||||||
|
}
|
||||||
|
dhcp->xid = xid;
|
||||||
}
|
}
|
||||||
dhcp->xid = xid;
|
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
|
||||||
("transaction id xid(%"X32_F")\n", xid));
|
("transaction id xid(%"X32_F")\n", xid));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user