diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index ca4a4b81..9ffc8b4e 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -310,7 +310,6 @@ struct ppp_addrs { * PPP interface control block. */ struct ppp_pcb_s { - /* -- below are data that will NOT be cleared between two sessions */ ppp_settings settings; const struct link_callbacks *link_cb; void *link_ctx_cb; @@ -320,13 +319,6 @@ struct ppp_pcb_s { #endif /* PPP_NOTIFY_PHASE */ void *ctx_cb; /* Callbacks optional pointer */ struct netif *netif; /* PPP interface */ - - /* -- below are data that will be cleared between two sessions */ - - /* - * phase must be the first member of cleared members, because it is used to know - * which part must not be cleared. - */ u8_t phase; /* where the link is at */ u8_t err_code; /* Code indicating why interface is down. */ diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index e9112111..16aba02f 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -697,11 +697,15 @@ void ppp_clear(ppp_pcb *pcb) { LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF", pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF); + /* Clean data not taken care by anything else, mostly shared data. */ #if PPP_STATS_SUPPORT link_stats_valid = 0; #endif /* PPP_STATS_SUPPORT */ - - memset(&pcb->phase, 0, sizeof(ppp_pcb) - ( (char*)&((ppp_pcb*)0)->phase - (char*)0 ) ); +#if MPPE_SUPPORT + pcb->mppe_keys_set = 0; + memset(&pcb->mppe_comp, 0, sizeof(pcb->mppe_comp)); + memset(&pcb->mppe_decomp, 0, sizeof(pcb->mppe_decomp)); +#endif /* MPPE_SUPPORT */ /* * Initialize each protocol.