feat(lwip): Add support for disabling IPv4 in PPP networks

This commit is contained in:
David Cermak
2024-06-07 16:23:41 +02:00
committed by David Čermák
parent 9ca974c8b3
commit 48b3e4f76f
3 changed files with 33 additions and 18 deletions

View File

@@ -231,7 +231,9 @@ netif_related_data_t * esp_netif_new_ppp(esp_netif_t *esp_netif, const esp_netif
#if PPP_NOTIFY_PHASE #if PPP_NOTIFY_PHASE
ppp_set_notify_phase_callback(ppp_obj->ppp, on_ppp_notify_phase); ppp_set_notify_phase_callback(ppp_obj->ppp, on_ppp_notify_phase);
#endif #endif
#if PPP_IPV4_SUPPORT
ppp_set_usepeerdns(ppp_obj->ppp, 1); ppp_set_usepeerdns(ppp_obj->ppp, 1);
#endif
return (netif_related_data_t *)ppp_obj; return (netif_related_data_t *)ppp_obj;
} }

View File

@@ -882,24 +882,6 @@ menu "LWIP"
default 0x0 if LWIP_TCPIP_TASK_AFFINITY_CPU0 default 0x0 if LWIP_TCPIP_TASK_AFFINITY_CPU0
default 0x1 if LWIP_TCPIP_TASK_AFFINITY_CPU1 default 0x1 if LWIP_TCPIP_TASK_AFFINITY_CPU1
menuconfig LWIP_PPP_SUPPORT
bool "Enable PPP support"
default n
help
Enable PPP stack. Now only PPP over serial is possible.
config LWIP_PPP_ENABLE_IPV6
bool "Enable IPV6 support for PPP connections (IPV6CP)"
depends on LWIP_PPP_SUPPORT && LWIP_IPV6
default y
help
Enable IPV6 support in PPP for the local link between the DTE (processor) and DCE (modem).
There are some modems which do not support the IPV6 addressing in the local link.
If they are requested for IPV6CP negotiation, they may time out.
This would in turn fail the configuration for the whole link.
If your modem is not responding correctly to PPP Phase Network, try to disable IPV6 support.
config LWIP_IPV6_MEMP_NUM_ND6_QUEUE config LWIP_IPV6_MEMP_NUM_ND6_QUEUE
int "Max number of IPv6 packets to queue during MAC resolution" int "Max number of IPv6 packets to queue during MAC resolution"
depends on LWIP_IPV6 depends on LWIP_IPV6
@@ -916,6 +898,32 @@ menu "LWIP"
help help
Config max number of entries in IPv6 neighbor cache Config max number of entries in IPv6 neighbor cache
menuconfig LWIP_PPP_SUPPORT
bool "Enable PPP support"
default n
help
Enable PPP stack. Now only PPP over serial is possible.
config LWIP_PPP_ENABLE_IPV4
bool "Enable IPV4 support for PPP connections (IPCP)"
depends on LWIP_PPP_SUPPORT && LWIP_IPV4
default y
help
Enable IPCP protocol in PPP negotiations, which assigns IPv4 addresses to the PPP client,
as well as IPv4 DNS servers.
You can disable this if your modem supports IPv6 only.
config LWIP_PPP_ENABLE_IPV6
bool "Enable IPV6 support for PPP connections (IPV6CP)"
depends on LWIP_PPP_SUPPORT && LWIP_IPV6
default y
help
Enable IPV6 support in PPP for the local link between the DTE (processor) and DCE (modem).
There are some modems which do not support the IPV6 addressing in the local link.
If they are requested for IPV6CP negotiation, they may time out.
This would in turn fail the configuration for the whole link.
If your modem is not responding correctly to PPP Phase Network, try to disable IPV6 support.
config LWIP_PPP_NOTIFY_PHASE_SUPPORT config LWIP_PPP_NOTIFY_PHASE_SUPPORT
bool "Enable Notify Phase Callback" bool "Enable Notify Phase Callback"
depends on LWIP_PPP_SUPPORT depends on LWIP_PPP_SUPPORT

View File

@@ -1080,6 +1080,11 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
*/ */
#define PPP_IPV6_SUPPORT CONFIG_LWIP_PPP_ENABLE_IPV6 #define PPP_IPV6_SUPPORT CONFIG_LWIP_PPP_ENABLE_IPV6
/**
* PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support
*/
#define PPP_IPV4_SUPPORT CONFIG_LWIP_PPP_ENABLE_IPV4
/** /**
* PPP_NOTIFY_PHASE==1: Support PPP notify phase. * PPP_NOTIFY_PHASE==1: Support PPP notify phase.
*/ */