summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ppp/ppp.c10
-rw-r--r--accel-pppd/ppp/ppp_ccp.c4
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;
}