Skip to content

Commit 070303d

Browse files
committed
Revert "Merge branch 'bugfix/fix_addr_changed_when_wifi_disconnect_v3.3' into 'release/v3.3'"
This reverts merge request !1377
1 parent 4a5dcb8 commit 070303d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/tcpip_adapter/tcpip_adapter_lwip.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ esp_err_t tcpip_adapter_up(tcpip_adapter_if_t tcpip_if)
448448
}
449449

450450
/* use last obtained ip, or static ip */
451-
esp_netif[tcpip_if]->flags |= NETIF_FLAG_UP;
451+
netif_set_addr(esp_netif[tcpip_if], &esp_ip[tcpip_if].ip, &esp_ip[tcpip_if].netmask, &esp_ip[tcpip_if].gw);
452+
netif_set_up(esp_netif[tcpip_if]);
452453
}
453454

454455
tcpip_adapter_update_default_netif();
@@ -479,7 +480,9 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if)
479480
tcpip_adapter_reset_ip_info(tcpip_if);
480481
}
481482

482-
esp_netif[tcpip_if]->flags &= ~NETIF_FLAG_UP;
483+
netif_set_addr(esp_netif[tcpip_if], IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
484+
netif_set_down(esp_netif[tcpip_if]);
485+
tcpip_adapter_start_ip_lost_timer(tcpip_if);
483486
}
484487

485488
tcpip_adapter_update_default_netif();

0 commit comments

Comments
 (0)