summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ppp_lcp.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-12-09 10:16:58 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-12-09 10:16:58 +0400
commitd0391e17b4a77f1762c898ff1e434bc13099052e (patch)
tree5b759359d6971610941607dd5f4bc2fb9541c7d5 /accel-pppd/ppp/ppp_lcp.c
parent03c5bd91157b042f9d98c1a1f437dadea6b0531a (diff)
downloadaccel-ppp-d0391e17b4a77f1762c898ff1e434bc13099052e.tar.gz
accel-ppp-d0391e17b4a77f1762c898ff1e434bc13099052e.zip
ppp: don't accept lcp ConfReq and similar packets after lcp was started
Diffstat (limited to 'accel-pppd/ppp/ppp_lcp.c')
-rw-r--r--accel-pppd/ppp/ppp_lcp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c
index 78a145af..58c21dcc 100644
--- a/accel-pppd/ppp/ppp_lcp.c
+++ b/accel-pppd/ppp/ppp_lcp.c
@@ -728,6 +728,9 @@ static void lcp_recv(struct ppp_handler_t*h)
if ((hdr->code == CONFACK || hdr->code == CONFNAK || hdr->code == CONFREJ) && hdr->id != lcp->fsm.id)
return;
+
+ if ((hdr->code == CONFACK || hdr->code == CONFNAK || hdr->code == CONFREJ) && lcp->started)
+ return;
if (lcp->fsm.fsm_state == FSM_Initial || lcp->fsm.fsm_state == FSM_Closed || (lcp->ppp->terminating && (hdr->code != TERMACK && hdr->code != TERMREQ))) {
/*if (conf_ppp_verbose)
@@ -741,6 +744,12 @@ static void lcp_recv(struct ppp_handler_t*h)
switch(hdr->code) {
case CONFREQ:
r = lcp_recv_conf_req(lcp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ if (lcp->started) {
+ if (r == LCP_OPT_ACK)
+ send_conf_ack(&lcp->fsm);
+ else
+ r = LCP_OPT_FAIL;
+ }
switch(r) {
case LCP_OPT_ACK:
ppp_fsm_recv_conf_req_ack(&lcp->fsm);