forked from espressif/esp-idf
Merge branch 'bugfix/lwip_dhcpserver' into 'wifi'
Bugfix/lwip dhcpserver TW6872 See merge request !50
This commit is contained in:
@@ -701,6 +701,7 @@ static s16_t parse_msg(struct dhcps_msg *m, u16_t len)
|
|||||||
client_address.addr = client_address_plus.addr;
|
client_address.addr = client_address_plus.addr;
|
||||||
renew = false;
|
renew = false;
|
||||||
|
|
||||||
|
if (plist != NULL){
|
||||||
for (pback_node = plist; pback_node != NULL;pback_node = pback_node->pnext) {
|
for (pback_node = plist; pback_node != NULL;pback_node = pback_node->pnext) {
|
||||||
pdhcps_pool = pback_node->pnode;
|
pdhcps_pool = pback_node->pnode;
|
||||||
if (memcmp(pdhcps_pool->mac, m->chaddr, sizeof(pdhcps_pool->mac)) == 0){
|
if (memcmp(pdhcps_pool->mac, m->chaddr, sizeof(pdhcps_pool->mac)) == 0){
|
||||||
@@ -718,8 +719,8 @@ static s16_t parse_msg(struct dhcps_msg *m, u16_t len)
|
|||||||
client_address.addr = client_address_plus.addr;
|
client_address.addr = client_address_plus.addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag == false) { // search the fisrt unused ip
|
if (flag == false) { // search the fisrt unused ip
|
||||||
if(first_address.addr < pdhcps_pool->ip.addr) {
|
if (first_address.addr < pdhcps_pool->ip.addr) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
addr_tmp.addr = htonl(first_address.addr);
|
addr_tmp.addr = htonl(first_address.addr);
|
||||||
@@ -728,6 +729,10 @@ static s16_t parse_msg(struct dhcps_msg *m, u16_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
client_address.addr = dhcps_poll.start_ip.addr;
|
||||||
|
}
|
||||||
|
|
||||||
if (client_address_plus.addr > dhcps_poll.end_ip.addr) {
|
if (client_address_plus.addr > dhcps_poll.end_ip.addr) {
|
||||||
client_address.addr = first_address.addr;
|
client_address.addr = first_address.addr;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user