summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-02-19 12:03:58 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-02-19 12:03:58 +0300
commit956cb489628621a2298937afeaed57cccf605bb2 (patch)
tree7934b06f280995edcfbe8b7ac6eb9a2240d9ae5d /accel-pppd/radius
parentc414d89fc30194bf3dddaf5d422baeb964178e93 (diff)
downloadaccel-ppp-956cb489628621a2298937afeaed57cccf605bb2.tar.gz
accel-ppp-956cb489628621a2298937afeaed57cccf605bb2.zip
radius: fixed invalid behaviour when route to radius server is not existing
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/req.c2
-rw-r--r--accel-pppd/radius/serv.c13
2 files changed, 12 insertions, 3 deletions
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 c0674819..d27d04f8 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;