Skip to content

Commit 67bdd07

Browse files
committed
feat(lwip): Random DHCP transaction id
internal gitlab: 51192735
1 parent 437f112 commit 67bdd07

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

VERSION

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ phy:
1818

1919
gitlab:
2020
driver : 68fc7b06
21-
lwip : 12cc0794
22-
mbedtls : e4dace14
21+
lwip : c097d4cf
22+
mbedtls : e4dace14

lib/liblwip.a

308 Bytes
Binary file not shown.

third_party/lwip/core/dhcp.c

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
9393
* #define DHCP_GLOBAL_XID_HEADER "stdlib.h"
9494
* #define DHCP_GLOBAL_XID rand()
9595
*/
96+
#define DHCP_GLOBAL_XID os_random()
97+
9698
#ifdef DHCP_GLOBAL_XID_HEADER
9799
#include DHCP_GLOBAL_XID_HEADER /* include optional starting XID generation prototypes */
98100
#endif
@@ -1721,7 +1723,11 @@ dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
17211723
if (message_type != DHCP_REQUEST) {
17221724
/* reuse transaction identifier in retransmissions */
17231725
if (dhcp->tries == 0) {
1726+
#ifndef DHCP_GLOBAL_XID
17241727
xid++;
1728+
#else
1729+
xid = DHCP_GLOBAL_XID;
1730+
#endif
17251731
}
17261732
dhcp->xid = xid;
17271733
}

0 commit comments

Comments
 (0)