mirror of https://github.com/ARMmbed/mbed-os.git
Corrected lwip to enable disabling of ipcp and ipv6cp protocols
parent
dd346ec5a8
commit
942aec5e4b
|
@ -336,6 +336,10 @@ struct ppp_pcb_s {
|
|||
unsigned int ipv6cp_is_up :1; /* have called ip6cp_up() */
|
||||
unsigned int if6_up :1; /* True when the IPv6 interface is up. */
|
||||
#endif /* PPP_IPV6_SUPPORT */
|
||||
#if PPP_IPV4_SUPPORT && PPP_IPV6_SUPPORT
|
||||
unsigned int ipcp_disabled :1; /* disable ipcp */
|
||||
unsigned int ipv6cp_disabled :1; /* disable ipv6cp */
|
||||
#endif
|
||||
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
||||
#if VJ_SUPPORT
|
||||
unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */
|
||||
|
|
|
@ -671,6 +671,11 @@ static void ipcp_close(ppp_pcb *pcb, const char *reason) {
|
|||
* ipcp_lowerup - The lower layer is up.
|
||||
*/
|
||||
static void ipcp_lowerup(ppp_pcb *pcb) {
|
||||
#if PPP_IPV4_SUPPORT && PPP_IPV6_SUPPORT
|
||||
if (pcb->ipcp_disabled) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
fsm *f = &pcb->ipcp_fsm;
|
||||
fsm_lowerup(f);
|
||||
}
|
||||
|
|
|
@ -473,6 +473,11 @@ static void ipv6cp_close(ppp_pcb *pcb, const char *reason) {
|
|||
* ipv6cp_lowerup - The lower layer is up.
|
||||
*/
|
||||
static void ipv6cp_lowerup(ppp_pcb *pcb) {
|
||||
#if PPP_IPV4_SUPPORT && PPP_IPV6_SUPPORT
|
||||
if (pcb->ipv6cp_disabled) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
fsm_lowerup(&pcb->ipv6cp_fsm);
|
||||
}
|
||||
|
||||
|
|
|
@ -335,11 +335,13 @@ extern "C" nsapi_error_t ppp_lwip_if_init(struct netif *netif, const nsapi_ip_st
|
|||
}
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
if (stack == IPV4_STACK) {
|
||||
my_ppp_pcb->ipv6cp_disabled = true;
|
||||
} else if (stack == IPV6_STACK) {
|
||||
my_ppp_pcb->ipcp_disabled = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NSAPI_ERROR_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue