Corrected lwip to enable disabling of ipcp and ipv6cp protocols

pull/4911/head
Mika Leppänen 2017-08-11 14:59:46 +03:00
parent dd346ec5a8
commit 942aec5e4b
4 changed files with 16 additions and 0 deletions

View File

@ -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. */

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}