summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/accel-ppp.conf2
-rw-r--r--accel-pppd/accel-ppp.conf.55
-rw-r--r--accel-pppd/radius/acct.c18
-rw-r--r--accel-pppd/radius/req.c14
4 files changed, 23 insertions, 16 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf
index ef8c822c..25d7aa11 100644
--- a/accel-pppd/accel-ppp.conf
+++ b/accel-pppd/accel-ppp.conf
@@ -144,7 +144,7 @@ interface=eth0
nas-identifier=accel-ppp
nas-ip-address=127.0.0.1
gw-ip-address=192.168.100.1
-server=127.0.0.1,testing123,auth-port=1812,acct-port=1813,req-limit=0,fail-time=0,weight=1
+server=127.0.0.1,testing123,auth-port=1812,acct-port=1813,req-limit=50,fail-timeout=0,max-fail=10,weight=1
dae-server=127.0.0.1:3799,testing123
verbose=1
#timeout=3
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index 1f53f323..f350b7b2 100644
--- a/accel-pppd/accel-ppp.conf.5
+++ b/accel-pppd/accel-ppp.conf.5
@@ -596,7 +596,7 @@ Specifies IP address, port and secret of authentication RADIUS server. (obsolete
.BI "acct-server=" x.x.x.x:port,secret
Specifies IP address, port and secret of accounting RADIUS server. (obsolete)
.TP
-.BI "server=" address,secret[,auth-port=1812][,acct-port=1813][,req-limit=0][,fail-time=0][,weight=1][,backup]
+.BI "server=" address,secret[,auth-port=1812][,acct-port=1813][,req-limit=0][,fail-timeout=0,max-fail=0,][,weight=1][,backup]
Specifies IP address, secret, ports of RADIUS server.
.br
.B req-limit
@@ -605,6 +605,9 @@ Specifies IP address, secret, ports of RADIUS server.
.B fail-time
- if server doesn't responds mark it as unavailable for this time (sec).
.br
+.B max-fail
+- number of unreplied requests in a row after that mark server as unavailable.
+.br
.B weight
- specifies weight of server for multi-server configuration.
.br
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index d6f2b182..de8ce286 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -303,15 +303,15 @@ out_err:
static void rad_acct_stop_sent(struct rad_req_t *req, int res)
{
if (res) {
- if (req->rpd)
+ if (ap_shutdown) {
+ struct radius_pd_t *rpd = req->rpd;
+
+ rad_req_free(req);
+
+ if (rpd)
+ rpd->acct_req = NULL;
+ } else if (req->rpd)
rad_acct_stop_defer(req->rpd);
- else {
- if (ap_shutdown) {
- rad_req_free(req);
- req->rpd->acct_req = NULL;
- } else
- req->try = 0;
- }
return;
}
@@ -348,6 +348,8 @@ static void rad_acct_stop_timeout(struct triton_timer_t *t)
{
struct rad_req_t *req = container_of(t, typeof(*req), timeout);
+ log_debug("timeout %p\n", req);
+
if (!req->rpd)
log_switch(triton_context_self(), NULL);
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 32fa44ca..b07198f4 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -353,12 +353,14 @@ int rad_req_send(struct rad_req_t *req)
req->send = __rad_req_send;
if (req->try++ == conf_max_try) {
- rad_server_req_exit(req);
-
- if (rad_server_realloc(req)) {
- if (req->rpd)
- log_ppp_warn("radius: no available servers\n");
- return -1;
+ if (req->active) {
+ rad_server_req_exit(req);
+
+ if (rad_server_realloc(req)) {
+ if (req->rpd)
+ log_ppp_warn("radius: no available servers\n");
+ return -1;
+ }
}
req->try = 1;