Merge branch 'bugfix/esp_netif_ip_reconnect_v5.0' into 'release/v5.0'

esp_netif: Post IP event for PPP netifs unconditionally (v5.0)

See merge request espressif/esp-idf!21670
This commit is contained in:
Jiang Jiang Jian 2023-01-12 16:21:26 +08:00
commit 179a2717c0

View File

@ -1107,10 +1107,12 @@ static void esp_netif_internal_dhcpc_cb(struct netif *netif)
if ( !ip4_addr_cmp(ip_2_ip4(&netif->ip_addr), IP4_ADDR_ANY4) ) {
//check whether IP is changed
if ( !ip4_addr_cmp(ip_2_ip4(&netif->ip_addr), (&ip_info->ip)) ||
!ip4_addr_cmp(ip_2_ip4(&netif->netmask), (&ip_info->netmask)) ||
!ip4_addr_cmp(ip_2_ip4(&netif->gw), (&ip_info->gw)) ) {
//check whether IP is changed (or if we're an PPP interface)
if ( (!ip4_addr_cmp(ip_2_ip4(&netif->ip_addr), (&ip_info->ip)) ||
!ip4_addr_cmp(ip_2_ip4(&netif->netmask), (&ip_info->netmask)) ||
!ip4_addr_cmp(ip_2_ip4(&netif->gw), (&ip_info->gw)))
// post IP event for PPP interfaces even if IP hasn't changed
|| (_IS_NETIF_ANY_POINT2POINT_TYPE(esp_netif))) {
ip_event_got_ip_t evt = {
.esp_netif = esp_netif,
.ip_changed = false,