Skip to content

Commit

Permalink
Merge branch 'bugfix/esp_netif_ip_reconnect' into 'master'
Browse files Browse the repository at this point in the history
esp_netif: Post IP event for PPP netifs unconditionally

Closes IDFGH-8893 and IDFGH-8899

See merge request espressif/esp-idf!21666
  • Loading branch information
david-cermak committed Jan 2, 2023
2 parents 4c98bee + 12fd902 commit bef3f2c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/esp_netif/lwip/esp_netif_lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,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,
Expand Down

0 comments on commit bef3f2c

Please sign in to comment.