fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST

This commit is contained in:
Simon Goldschmidt 2014-02-27 22:44:16 +01:00
parent d9d0c52770
commit c82f04f54c
2 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -1671,6 +1671,8 @@ 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)));
/* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */
if (message_type != DHCP_REQUEST) {
/* reuse transaction identifier in retransmissions */ /* reuse transaction identifier in retransmissions */
if (dhcp->tries == 0) { if (dhcp->tries == 0) {
#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND) #if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
@ -1680,6 +1682,7 @@ dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
#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));