From 6f3e3636e5cb47a0fb1e408f06e5c32e125af595 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 13 May 2024 14:29:14 +0200 Subject: [PATCH] fix(esp_netif): Fix PPP server to negotiate its own address is configured Closes https://github.com/espressif/esp-protocols/issues/565 --- components/esp_netif/lwip/esp_netif_lwip_ppp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/esp_netif/lwip/esp_netif_lwip_ppp.c b/components/esp_netif/lwip/esp_netif_lwip_ppp.c index 03a11bafe3b..259ec9f4b75 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_ppp.c +++ b/components/esp_netif/lwip/esp_netif_lwip_ppp.c @@ -256,6 +256,10 @@ esp_err_t esp_netif_start_ppp(esp_netif_t *esp_netif) // Set our preferred address, and accept the remote ppp_ctx->ppp->ipcp_wantoptions.ouraddr = ppp_ctx->ppp_our_ip4_addr.addr; ppp_ctx->ppp->ipcp_wantoptions.accept_remote = 1; + ppp_ctx->ppp->ask_for_local = 1; /* `ask_for_local` option in the lwip's pcb is `0` by default and causes + * the initial negotiation IPCP request to reset our own address to '0.0.0.0'. + * https://github.com/lwip-tcpip/lwip/blob/1cc1536e/src/netif/ppp/ipcp.c#L728-L729 + */ } if (ppp_ctx->ppp_their_ip4_addr.addr != IPADDR_ANY) { // Set their preferred address, and accept the local