diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 69b69592..8428dfb7 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -367,8 +367,6 @@ setdeflate(argv) */ static void ccp_init(ppp_pcb *pcb) { fsm *f = &pcb->ccp_fsm; - ccp_options *wo = &pcb->ccp_wantoptions; - ccp_options *ao = &pcb->ccp_allowoptions; f->pcb = pcb; f->protocol = PPP_CCP; @@ -403,14 +401,6 @@ static void ccp_init(ppp_pcb *pcb) { #if PREDICTOR_SUPPORT ao->predictor_1 = 1; #endif /* PREDICTOR_SUPPORT */ - -#if MPPE_SUPPORT - if (pcb->settings.require_mppe) { - wo->mppe = ao->mppe = - (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) - | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); - } -#endif /* MPPE_SUPPORT */ } /* @@ -552,6 +542,9 @@ static void ccp_resetci(fsm *f) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; ccp_options *wo = &pcb->ccp_wantoptions; +#if MPPE_SUPPORT + ccp_options *ao = &pcb->ccp_allowoptions; +#endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT u_char opt_buf[CCP_MAX_OPTION_LENGTH]; #endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */ @@ -559,12 +552,19 @@ static void ccp_resetci(fsm *f) { int res; #endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */ +#if MPPE_SUPPORT + if (pcb->settings.require_mppe) { + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + } +#endif /* MPPE_SUPPORT */ + *go = *wo; pcb->ccp_all_rejected = 0; #if MPPE_SUPPORT if (go->mppe) { - ccp_options *ao = &pcb->ccp_allowoptions; int auth_mschap_bits = pcb->auth_done; int numbits;