mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tcpip_adapter: fix bug 7462
modify the code execution condition
This commit is contained in:
parent
527767d31c
commit
7114f933bb
@ -393,6 +393,7 @@ esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_option_mode_t opt_op, tcpip_a
|
|||||||
uint32_t end_ip = 0;
|
uint32_t end_ip = 0;
|
||||||
dhcps_lease_t *poll = opt_val;
|
dhcps_lease_t *poll = opt_val;
|
||||||
|
|
||||||
|
if (poll->enable){
|
||||||
memset(&info, 0x00, sizeof(tcpip_adapter_ip_info_t));
|
memset(&info, 0x00, sizeof(tcpip_adapter_ip_info_t));
|
||||||
tcpip_adapter_get_ip_info(WIFI_IF_AP, &info);
|
tcpip_adapter_get_ip_info(WIFI_IF_AP, &info);
|
||||||
softap_ip = htonl(info.ip.addr);
|
softap_ip = htonl(info.ip.addr);
|
||||||
@ -413,6 +414,7 @@ esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_option_mode_t opt_op, tcpip_a
|
|||||||
if (end_ip - start_ip > DHCPS_MAX_LEASE) {
|
if (end_ip - start_ip > DHCPS_MAX_LEASE) {
|
||||||
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
|
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(opt_info, opt_val, opt_len);
|
memcpy(opt_info, opt_val, opt_len);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user