From 435c18ba35f9515727e63b4de92912d7567b5534 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 24 Jan 2018 10:25:33 +0300 Subject: ppp: fixed bug in ppp_terminate --- accel-pppd/ppp/ppp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 264ae136..1ee26f4e 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -558,8 +558,10 @@ int __export ppp_terminate(struct ap_session *ses, int hard) } } - if (!s) + if (!s) { destablish_ppp(ppp); + return 0; + } return 1; } -- cgit v1.2.3 From 120d9cb4b14fb524d71924db96cca0d91a5ca281 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 19 Feb 2018 12:03:58 +0300 Subject: radius: fixed invalid behaviour when route to radius server is not existing --- accel-pppd/radius/req.c | 2 +- accel-pppd/radius/serv.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c index b09b8806..b6c4cf0b 100644 --- a/accel-pppd/radius/req.c +++ b/accel-pppd/radius/req.c @@ -313,7 +313,7 @@ int __rad_req_send(struct rad_req_t *req, int async) } if (req->hnd.fd == -1 && make_socket(req)) - return -1; + return -2; if (req->before_send && req->before_send(req)) goto out_err; diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c index 7372fdc1..64db6cdf 100644 --- a/accel-pppd/radius/serv.c +++ b/accel-pppd/radius/serv.c @@ -227,8 +227,17 @@ int rad_server_req_enter(struct rad_req_t *req) if (req->send) { r = req->send(req, 0); - if (r) - req->active = 0; + if (r) { + if (r == -2) { + req->active = 0; + pthread_mutex_lock(&req->serv->lock); + req->serv->req_cnt--; + pthread_mutex_unlock(&req->serv->lock); + + rad_server_fail(req->serv); + } else + rad_server_req_exit(req); + } } return r; -- cgit v1.2.3