mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'fix/lwip_sec_high_v5.3' into 'release/v5.3'
fix(lwip): high severity lwip fixes (v5.3) See merge request espressif/esp-idf!50596
This commit is contained in:
@@ -1174,11 +1174,19 @@ static s16_t parse_msg(dhcps_t *dhcps, struct dhcps_msg *m, u16_t len)
|
|||||||
pnode = NULL;
|
pnode = NULL;
|
||||||
} else {
|
} else {
|
||||||
pdhcps_pool = (struct dhcps_pool *)mem_calloc(1, sizeof(struct dhcps_pool));
|
pdhcps_pool = (struct dhcps_pool *)mem_calloc(1, sizeof(struct dhcps_pool));
|
||||||
|
if (pdhcps_pool == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
pdhcps_pool->ip.addr = dhcps->client_address.addr;
|
pdhcps_pool->ip.addr = dhcps->client_address.addr;
|
||||||
memcpy(pdhcps_pool->mac, m->chaddr, sizeof(pdhcps_pool->mac));
|
memcpy(pdhcps_pool->mac, m->chaddr, sizeof(pdhcps_pool->mac));
|
||||||
pdhcps_pool->lease_timer = lease_timer;
|
pdhcps_pool->lease_timer = lease_timer;
|
||||||
pnode = (list_node *)mem_calloc(1, sizeof(list_node));
|
pnode = (list_node *)mem_calloc(1, sizeof(list_node));
|
||||||
|
if (pnode == NULL) {
|
||||||
|
mem_free(pdhcps_pool);
|
||||||
|
pdhcps_pool = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
pnode->pnode = pdhcps_pool;
|
pnode->pnode = pdhcps_pool;
|
||||||
pnode->pnext = NULL;
|
pnode->pnext = NULL;
|
||||||
|
|||||||
@@ -210,6 +210,9 @@ void dhcp_parse_extra_opts(struct dhcp *dhcp, uint8_t state, uint8_t option, uin
|
|||||||
NETIF_FOREACH(netif) {
|
NETIF_FOREACH(netif) {
|
||||||
/* find the netif related to this dhcp */
|
/* find the netif related to this dhcp */
|
||||||
if (dhcp == netif_dhcp_data(netif)) {
|
if (dhcp == netif_dhcp_data(netif)) {
|
||||||
|
if (mtu < 68) { /* RFC 2132 requires MTU >= 68 */
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mtu < netif->mtu) {
|
if (mtu < netif->mtu) {
|
||||||
netif->mtu = mtu;
|
netif->mtu = mtu;
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_parse_extra_opts(): Negotiated netif MTU is %d\n", netif->mtu));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_parse_extra_opts(): Negotiated netif MTU is %d\n", netif->mtu));
|
||||||
|
|||||||
Reference in New Issue
Block a user