summaryrefslogtreecommitdiff
path: root/accel-pptpd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd')
-rw-r--r--accel-pptpd/ctrl/pptp.c2
-rw-r--r--accel-pptpd/ppp/ppp.c5
-rw-r--r--accel-pptpd/ppp/ppp_ccp.c7
-rw-r--r--accel-pptpd/ppp/ppp_fsm.c10
-rw-r--r--accel-pptpd/ppp/ppp_lcp.c5
5 files changed, 24 insertions, 5 deletions
diff --git a/accel-pptpd/ctrl/pptp.c b/accel-pptpd/ctrl/pptp.c
index fddd00f..73282b6 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 dbb6709..9491977 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 477b624..6deaeb1 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 4fc60c2..6efc2e0 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 c6415e9..02fafab 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: