]> granicus.if.org Git - esp-idf/commit
Fix the bug that if one device is in station+softap mode, other device can not
authorXiaXiaotian <xiaxiaotian@espressif.com>
Fri, 22 Sep 2017 10:10:34 +0000 (18:10 +0800)
committerXiaXiaotian <xiaxiaotian@espressif.com>
Sat, 23 Sep 2017 12:18:50 +0000 (20:18 +0800)
commit20064978ba78300c0fc00158b0eb4f7ff54a47e4
tree4e2b0a515f9803c7c141b4b913ee448792c31848
parentd50aca62c32c2ff13b286e981d2ecb38e67f59c8
Fix the bug that if one device is in station+softap mode, other device can not
get IP address after connecting to the softap.

    Now the default netif is station in station+softap mode. The UDP pcb of
DHCP server is binded to IP 0.0.0.0. When other device connects to softap, the
DHCP offer will be sent by softap.But because the destination IP of DHCP offer
is broadcast IP and the source IP of it is 0.0.0.0, it will be sent from default
netif, that is station interface. Other device can not receive the DHCP offer
sent from station interface. As a result, other device can not get IP address.
The resolution is that bind UDP pcb to the IP address of softap. So, the source
IP of DHCP offer is that of softap. DHCP offer can be sent from softap interface
by source IP route method.
components/lwip/apps/dhcpserver.c
components/tcpip_adapter/tcpip_adapter_lwip.c