diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2010-09-28 02:49:13 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2010-09-28 02:49:13 +0400 |
commit | b74a11aac87784e2922d621ab27aed3aa6d1db44 (patch) | |
tree | c2e7e60aa9c6de58a4ce655553f7d0e4bb745566 | |
parent | ea1ac5b186bd377915e9905a17b2e67df6d0bb50 (diff) | |
download | accel-ppp-b74a11aac87784e2922d621ab27aed3aa6d1db44.tar.gz accel-ppp-b74a11aac87784e2922d621ab27aed3aa6d1db44.zip |
bug fixes
-rw-r--r-- | accel-pptpd/ctrl/pptp.c | 2 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp.c | 5 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp_ccp.c | 7 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp_fsm.c | 10 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp_lcp.c | 5 |
5 files changed, 24 insertions, 5 deletions
diff --git a/accel-pptpd/ctrl/pptp.c b/accel-pptpd/ctrl/pptp.c index fddd00fa..73282b6f 100644 --- a/accel-pptpd/ctrl/pptp.c +++ b/accel-pptpd/ctrl/pptp.c @@ -317,7 +317,7 @@ static int pptp_echo_rply(struct pptp_conn_t *conn) struct pptp_echo_rply *msg = (struct pptp_echo_rply *)conn->in_buf; if (msg->identifier != conn->echo_sent) { log_ppp_warn("pptp:echo: identifier mismatch\n"); - return -1; + //return -1; } conn->echo_sent = 0; return 0; diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c index dbb6709d..94919779 100644 --- a/accel-pptpd/ppp/ppp.c +++ b/accel-pptpd/ppp/ppp.c @@ -325,7 +325,10 @@ cont: void __export ppp_layer_started(struct ppp_t *ppp, struct ppp_layer_data_t *d) { struct layer_node_t *n=d->node; - + + if (d->started) + return; + d->started=1; list_for_each_entry(d,&n->items,entry) diff --git a/accel-pptpd/ppp/ppp_ccp.c b/accel-pptpd/ppp/ppp_ccp.c index 477b6242..6deaeb18 100644 --- a/accel-pptpd/ppp/ppp_ccp.c +++ b/accel-pptpd/ppp/ppp_ccp.c @@ -105,6 +105,12 @@ int ccp_layer_start(struct ppp_layer_data_t *ld) log_ppp_debug("ccp_layer_start\n"); ccp_options_init(ccp); + + if (list_empty(&ccp->options)) { + ppp_layer_started(ccp->ppp, &ccp->ld); + return 0; + } + ppp_fsm_lower_up(&ccp->fsm); if (ppp_fsm_open(&ccp->fsm)) return -1; @@ -529,6 +535,7 @@ static void ccp_recv(struct ppp_handler_t*h) if (ccp->fsm.fsm_state==FSM_Initial || ccp->fsm.fsm_state==FSM_Closed) { log_ppp_warn("CCP: discaring packet\n"); + lcp_send_proto_rej(ccp->ppp, htons(PPP_CCP)); return; } diff --git a/accel-pptpd/ppp/ppp_fsm.c b/accel-pptpd/ppp/ppp_fsm.c index 4fc60c21..6efc2e07 100644 --- a/accel-pptpd/ppp/ppp_fsm.c +++ b/accel-pptpd/ppp/ppp_fsm.c @@ -277,11 +277,19 @@ void ppp_fsm_recv_conf_req_rej(struct ppp_fsm_t *layer) --layer->restart_counter; if (layer->send_conf_req) layer->send_conf_req(layer); case FSM_Ack_Sent: + if (++layer->conf_failure == layer->max_failure) { + if (layer->layer_down) layer->layer_down(layer); + return; + } if (layer->send_conf_rej) layer->send_conf_rej(layer); layer->fsm_state=FSM_Req_Sent; break; case FSM_Req_Sent: case FSM_Ack_Rcvd: + if (++layer->conf_failure == layer->max_failure) { + if (layer->layer_down) layer->layer_down(layer); + return; + } if (layer->send_conf_rej) layer->send_conf_rej(layer); break; case FSM_Opened: @@ -342,7 +350,7 @@ void ppp_fsm_recv_conf_rej(struct ppp_fsm_t *layer) break; case FSM_Req_Sent: if (++layer->conf_failure == layer->max_failure) { - ppp_terminate(layer->ppp, 0); + if (layer->layer_down) layer->layer_down(layer); return; } //if (layer->init_req_cnt) layer->init_req_cnt(layer); diff --git a/accel-pptpd/ppp/ppp_lcp.c b/accel-pptpd/ppp/ppp_lcp.c index c6415e9f..02fafab8 100644 --- a/accel-pptpd/ppp/ppp_lcp.c +++ b/accel-pptpd/ppp/ppp_lcp.c @@ -379,7 +379,7 @@ static int lcp_recv_conf_req(struct ppp_lcp_t *lcp,uint8_t *data,int size) } log_ppp_debug("]\n"); - list_for_each_entry(lopt,&lcp->options,entry) + /*list_for_each_entry(lopt,&lcp->options,entry) { if (lopt->state==LCP_OPT_NONE) { @@ -387,7 +387,7 @@ static int lcp_recv_conf_req(struct ppp_lcp_t *lcp,uint8_t *data,int size) lopt->state=r; if (r<ret) ret=r; } - } + }*/ return ret; } @@ -719,6 +719,7 @@ static void lcp_recv(struct ppp_handler_t*h) ppp_fsm_recv_code_rej_bad(&lcp->fsm); break; case ECHOREQ: + log_ppp_debug("recv [LCP EchoReq id=%x <magic %x>]\n",hdr->id, *(uint32_t*)(hdr + 1)); send_echo_reply(lcp); break; case ECHOREP: |