mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-04 20:53:06 +08:00
fix(lwip): Fix compile issue while remove define of TRUE/FALSE
This commit is contained in:
@ -12,6 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
@ -925,26 +926,26 @@ static void wifi_softap_init_dhcps_lease(u32_t ip)
|
|||||||
u32_t start_ip = 0;
|
u32_t start_ip = 0;
|
||||||
u32_t end_ip = 0;
|
u32_t end_ip = 0;
|
||||||
|
|
||||||
if (dhcps_lease.enable == TRUE) {
|
if (dhcps_lease.enable == true) {
|
||||||
softap_ip = htonl(ip);
|
softap_ip = htonl(ip);
|
||||||
start_ip = htonl(dhcps_lease.start_ip.addr);
|
start_ip = htonl(dhcps_lease.start_ip.addr);
|
||||||
end_ip = htonl(dhcps_lease.end_ip.addr);
|
end_ip = htonl(dhcps_lease.end_ip.addr);
|
||||||
|
|
||||||
/*config ip information can't contain local ip*/
|
/*config ip information can't contain local ip*/
|
||||||
if ((start_ip <= softap_ip) && (softap_ip <= end_ip)) {
|
if ((start_ip <= softap_ip) && (softap_ip <= end_ip)) {
|
||||||
dhcps_lease.enable = FALSE;
|
dhcps_lease.enable = false;
|
||||||
} else {
|
} else {
|
||||||
/*config ip information must be in the same segment as the local ip*/
|
/*config ip information must be in the same segment as the local ip*/
|
||||||
softap_ip >>= 8;
|
softap_ip >>= 8;
|
||||||
|
|
||||||
if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
|
if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
|
||||||
|| (end_ip - start_ip > DHCPS_MAX_LEASE)) {
|
|| (end_ip - start_ip > DHCPS_MAX_LEASE)) {
|
||||||
dhcps_lease.enable = FALSE;
|
dhcps_lease.enable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dhcps_lease.enable == FALSE) {
|
if (dhcps_lease.enable == false) {
|
||||||
local_ip = softap_ip = htonl(ip);
|
local_ip = softap_ip = htonl(ip);
|
||||||
softap_ip &= 0xFFFFFF00;
|
softap_ip &= 0xFFFFFF00;
|
||||||
local_ip &= 0xFF;
|
local_ip &= 0xFF;
|
||||||
@ -1086,7 +1087,7 @@ bool wifi_softap_get_dhcps_lease(struct dhcps_lease* please)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dhcps_lease.enable == FALSE) {
|
if (dhcps_lease.enable == false) {
|
||||||
if (wifi_softap_dhcps_status() == DHCP_STOPPED) {
|
if (wifi_softap_dhcps_status() == DHCP_STOPPED) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user