diff options
author | Kozlov Dmitry <dima@server> | 2010-11-16 17:19:33 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-11-16 17:19:33 +0300 |
commit | e95fc28b08669e329916e1cf1eb52fa462ad655a (patch) | |
tree | b584a8719fc5950ae9f683c6ce865ee074e3e450 /accel-pptpd/ppp | |
parent | 50881d86b036e3b658c45e56b57b12a60e1562ef (diff) | |
download | accel-ppp-e95fc28b08669e329916e1cf1eb52fa462ad655a.tar.gz accel-ppp-e95fc28b08669e329916e1cf1eb52fa462ad655a.zip |
log-tcp: fixed incorrect queue overflow handling
ppp: fixed memory leak when ipcp raises error at ConfReq
Diffstat (limited to 'accel-pptpd/ppp')
-rw-r--r-- | accel-pptpd/ppp/ppp.c | 8 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp.h | 1 | ||||
-rw-r--r-- | accel-pptpd/ppp/ppp_ipcp.c | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c index a26e644..acda605 100644 --- a/accel-pptpd/ppp/ppp.c +++ b/accel-pptpd/ppp/ppp.c @@ -210,6 +210,8 @@ static void destablish_ppp(struct ppp_t *ppp) _free_layers(ppp); + ppp->terminated = 1; + log_ppp_debug("ppp destablished\n"); triton_event_fire(EV_PPP_FINISHED, ppp); @@ -411,7 +413,11 @@ void __export ppp_terminate(struct ppp_t *ppp, int cause, int hard) struct ppp_layer_data_t *d; int s = 0; - time(&ppp->stop_time); + if (ppp->terminated) + return; + + if (!ppp->stop_time) + time(&ppp->stop_time); if (!ppp->terminate_cause) ppp->terminate_cause = cause; diff --git a/accel-pptpd/ppp/ppp.h b/accel-pptpd/ppp/ppp.h index f74351d..1a97099 100644 --- a/accel-pptpd/ppp/ppp.h +++ b/accel-pptpd/ppp/ppp.h @@ -98,6 +98,7 @@ struct ppp_t struct ppp_ctrl_t *ctrl; int terminating:1; + int terminated:1; int terminate_cause; void *chan_buf; diff --git a/accel-pptpd/ppp/ppp_ipcp.c b/accel-pptpd/ppp/ppp_ipcp.c index 3248db6..3229893 100644 --- a/accel-pptpd/ppp/ppp_ipcp.c +++ b/accel-pptpd/ppp/ppp_ipcp.c @@ -579,8 +579,10 @@ static void ipcp_recv(struct ppp_handler_t*h) switch(hdr->code) { case CONFREQ: r = ipcp_recv_conf_req(ipcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN); - if (ipcp->ppp->stop_time) + if (ipcp->ppp->stop_time) { + ipcp_free_conf_req(ipcp); return; + } switch(r) { case IPCP_OPT_ACK: ppp_fsm_recv_conf_req_ack(&ipcp->fsm); |