diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-09-10 21:01:34 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-09-10 21:01:34 +0400 |
commit | 385004bfc3a4daa2a0ab6cb88852698eebdc6c3d (patch) | |
tree | 465cfeaf3536e148e48ec99e97ac80a513c04f0b /accel-pppd/ppp | |
parent | b573534e69970273bab36b0041142fe0692c30e1 (diff) | |
download | accel-ppp-385004bfc3a4daa2a0ab6cb88852698eebdc6c3d.tar.gz accel-ppp-385004bfc3a4daa2a0ab6cb88852698eebdc6c3d.zip |
ppp: don't start ccp after ipcp was started
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r-- | accel-pppd/ppp/ppp.c | 10 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_ccp.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index b0f34741..08486899 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -450,10 +450,12 @@ static void __ppp_layer_started(struct ppp_t *ppp, struct ppp_layer_data_t *d) if (n->entry.next == &ppp->layers) { - ppp->state = PPP_STATE_ACTIVE; - __sync_sub_and_fetch(&ppp_stat.starting, 1); - __sync_add_and_fetch(&ppp_stat.active, 1); - ppp_ifup(ppp); + if (ppp->state == PPP_STATE_STARTING) { + ppp->state = PPP_STATE_ACTIVE; + __sync_sub_and_fetch(&ppp_stat.starting, 1); + __sync_add_and_fetch(&ppp_stat.active, 1); + ppp_ifup(ppp); + } } else { n = list_entry(n->entry.next, typeof(*n), entry); list_for_each_entry(d, &n->items, entry) { diff --git a/accel-pppd/ppp/ppp_ccp.c b/accel-pppd/ppp/ppp_ccp.c index aac7ac2f..88adc30b 100644 --- a/accel-pppd/ppp/ppp_ccp.c +++ b/accel-pppd/ppp/ppp_ccp.c @@ -623,10 +623,10 @@ static void ccp_recv(struct ppp_handler_t*h) struct ppp_ccp_t *ccp = container_of(h, typeof(*ccp), hnd); int r; - if (!ccp->starting || ccp->fsm.fsm_state == FSM_Closed || ccp->ppp->terminating) { + if (!ccp->starting || ccp->fsm.fsm_state == FSM_Closed || ccp->ppp->terminating || ccp->ppp->state == PPP_STATE_ACTIVE) { if (conf_ppp_verbose) log_ppp_warn("CCP: discarding packet\n"); - if (ccp->fsm.fsm_state == FSM_Closed || !conf_ccp) + if (ccp->fsm.fsm_state == FSM_Closed || !conf_ccp || ccp->ppp->state == PPP_STATE_ACTIVE) lcp_send_proto_rej(ccp->ppp, PPP_CCP); return; } |