Skip to content

Commit

Permalink
Merge branch 'fix/netif_ppp_server_negotiate_own_addr' into 'master'
Browse files Browse the repository at this point in the history
fix(esp_netif): Fix PPP server to negotiate its own address is configured

Closes IDFGH-12759

See merge request espressif/esp-idf!30810
  • Loading branch information
david-cermak committed Jun 5, 2024
2 parents 5d77ee2 + 99b0a76 commit 4e5c837
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/esp_netif/lwip/esp_netif_lwip_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static void on_ppp_notify_phase(ppp_pcb *pcb, u8_t phase, void *ctx)
#endif // PPP_NOTIFY_PHASE

/**
* @brief PPP low level output callback used to transmit data using standard esp-netif interafce
* @brief PPP low level output callback used to transmit data using standard esp-netif interface
*
* @param pcb PPP control block
* @param data Buffer to write to serial port
Expand Down Expand Up @@ -255,6 +255,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
Expand Down

0 comments on commit 4e5c837

Please sign in to comment.