mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +00:00
PPP, CCP, move user configuration from ccp_init to ccp_resetci
ccp_init() is meant to be called once, providing default configuration before user specific configuration is applied. In pppd user configuration is set just after all protocol init functions are called, in lwIP we use protocol reset functions to do that, which is more or less the same. Therefore, be consistent and move CCP user configuration from ccp_init to ccp_resetci.
This commit is contained in:
parent
6d95a34971
commit
c751802fad
@ -367,8 +367,6 @@ setdeflate(argv)
|
|||||||
*/
|
*/
|
||||||
static void ccp_init(ppp_pcb *pcb) {
|
static void ccp_init(ppp_pcb *pcb) {
|
||||||
fsm *f = &pcb->ccp_fsm;
|
fsm *f = &pcb->ccp_fsm;
|
||||||
ccp_options *wo = &pcb->ccp_wantoptions;
|
|
||||||
ccp_options *ao = &pcb->ccp_allowoptions;
|
|
||||||
|
|
||||||
f->pcb = pcb;
|
f->pcb = pcb;
|
||||||
f->protocol = PPP_CCP;
|
f->protocol = PPP_CCP;
|
||||||
@ -403,14 +401,6 @@ static void ccp_init(ppp_pcb *pcb) {
|
|||||||
#if PREDICTOR_SUPPORT
|
#if PREDICTOR_SUPPORT
|
||||||
ao->predictor_1 = 1;
|
ao->predictor_1 = 1;
|
||||||
#endif /* PREDICTOR_SUPPORT */
|
#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;
|
ppp_pcb *pcb = f->pcb;
|
||||||
ccp_options *go = &pcb->ccp_gotoptions;
|
ccp_options *go = &pcb->ccp_gotoptions;
|
||||||
ccp_options *wo = &pcb->ccp_wantoptions;
|
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
|
#if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT
|
||||||
u_char opt_buf[CCP_MAX_OPTION_LENGTH];
|
u_char opt_buf[CCP_MAX_OPTION_LENGTH];
|
||||||
#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */
|
#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */
|
||||||
@ -559,12 +552,19 @@ static void ccp_resetci(fsm *f) {
|
|||||||
int res;
|
int res;
|
||||||
#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */
|
#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;
|
*go = *wo;
|
||||||
pcb->ccp_all_rejected = 0;
|
pcb->ccp_all_rejected = 0;
|
||||||
|
|
||||||
#if MPPE_SUPPORT
|
#if MPPE_SUPPORT
|
||||||
if (go->mppe) {
|
if (go->mppe) {
|
||||||
ccp_options *ao = &pcb->ccp_allowoptions;
|
|
||||||
int auth_mschap_bits = pcb->auth_done;
|
int auth_mschap_bits = pcb->auth_done;
|
||||||
int numbits;
|
int numbits;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user