summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp/ppp_ipcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/ppp/ppp_ipcp.c')
-rw-r--r--accel-pptpd/ppp/ppp_ipcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/accel-pptpd/ppp/ppp_ipcp.c b/accel-pptpd/ppp/ppp_ipcp.c
index f3c20a6..420b9b8 100644
--- a/accel-pptpd/ppp/ppp_ipcp.c
+++ b/accel-pptpd/ppp/ppp_ipcp.c
@@ -77,7 +77,8 @@ static struct ppp_layer_data_t *ipcp_layer_init(struct ppp_t *ppp)
ipcp->hnd.recv=ipcp_recv;
ppp_register_unit_handler(ppp,&ipcp->hnd);
-
+
+ ipcp->fsm.proto = PPP_IPCP;
ppp_fsm_init(&ipcp->fsm);
ipcp->fsm.layer_up=ipcp_layer_up;
@@ -541,14 +542,14 @@ static void ipcp_recv(struct ppp_handler_t*h)
ppp_fsm_recv_conf_rej(&ipcp->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 [IPCP TermReq id=%x \"%s\"]\n",hdr->id,term_msg);
_free(term_msg);
ppp_fsm_recv_term_req(&ipcp->fsm);
ppp_terminate(ipcp->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 [IPCP TermAck id=%x \"%s\"]\n",hdr->id,term_msg);
_free(term_msg);
ppp_fsm_recv_term_ack(&ipcp->fsm);