summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/ppp')
-rw-r--r--accel-pptpd/ppp/ppp_fsm.c2
-rw-r--r--accel-pptpd/ppp/ppp_lcp.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/accel-pptpd/ppp/ppp_fsm.c b/accel-pptpd/ppp/ppp_fsm.c
index 20fe8fff..0e11b660 100644
--- a/accel-pptpd/ppp/ppp_fsm.c
+++ b/accel-pptpd/ppp/ppp_fsm.c
@@ -26,6 +26,7 @@ void ppp_fsm_init(struct ppp_fsm_t *layer)
{
layer->fsm_state = FSM_Initial;
layer->restart_timer.expire = restart_timer_func;
+ layer->restart_timer.period = conf_timeout * 1000;
layer->restart_counter = 0;
layer->max_terminate = conf_max_terminate;
@@ -492,7 +493,6 @@ static void stop_timer(struct ppp_fsm_t *fsm)
}
static void init_req_counter(struct ppp_fsm_t *layer,int timeout)
{
- layer->restart_timer.expire_tv.tv_sec=0;
layer->restart_counter = timeout;
if (!layer->restart_timer.tpd)
diff --git a/accel-pptpd/ppp/ppp_lcp.c b/accel-pptpd/ppp/ppp_lcp.c
index 3b937d6e..b5afb5a3 100644
--- a/accel-pptpd/ppp/ppp_lcp.c
+++ b/accel-pptpd/ppp/ppp_lcp.c
@@ -504,6 +504,7 @@ static void send_echo_reply(struct ppp_lcp_t *lcp)
uint32_t magic = *(uint32_t *)(hdr+1);
hdr->code=ECHOREP;
+ *(uint32_t *)(hdr+1) = lcp->magic;
log_ppp_debug("send [LCP EchoRep id=%x <magic %x>]\n", hdr->id, magic);
ppp_chan_send(lcp->ppp,hdr,ntohs(hdr->len)+2);
@@ -606,14 +607,14 @@ static void lcp_recv(struct ppp_handler_t*h)
ppp_fsm_recv_conf_rej(&lcp->fsm);
break;
case TERMREQ:
- term_msg=strndup((char*)(hdr+1),ntohs(hdr->len));
+ term_msg=strndup((char*)(hdr+1),ntohs(hdr->len)-4);
log_ppp_debug("recv [LCP TermReq id=%x \"%s\"]\n",hdr->id,term_msg);
free(term_msg);
ppp_fsm_recv_term_req(&lcp->fsm);
ppp_terminate(lcp->ppp, 0);
break;
case TERMACK:
- term_msg=strndup((char*)(hdr+1),ntohs(hdr->len));
+ term_msg=strndup((char*)(hdr+1),ntohs(hdr->len)-4);
log_ppp_debug("recv [LCP TermAck id=%x \"%s\"]\n",hdr->id,term_msg);
free(term_msg);
ppp_fsm_recv_term_ack(&lcp->fsm);