Code: Select all
/*config ip information can't contain local ip*/
if ((start_ip <= softap_ip) && (softap_ip <= end_ip)) {
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS; <------------------- HERE
}
/*config ip information must be in the same segment as the local ip*/
softap_ip >>= 8;
if ((start_ip >> 8 != softap_ip)
|| (end_ip >> 8 != softap_ip)) {
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
}
if (end_ip - start_ip > DHCPS_MAX_LEASE) {
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
}
Since all the body of the "if" statements are the same in each case (a simple return statement), I'm going to guess that the compiler has decided to "optimize" them to the first one encountered and that is why we are seeing that the return is the return belonging to the wrong if conditional.
My takeaway from this is to be a little bit careful when stepping through code because this is at least one occurrence where stepping doesn't appear to execute sequential code.