radius: notify of disconnect timeout reason

This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-09 21:34:09 +02:00
committed by Nikos Mavrogiannopoulos
parent 5e6d15db45
commit ad9e3da777
3 changed files with 4 additions and 1 deletions

View File

@@ -257,6 +257,8 @@ VALUE_PAIR *send = NULL, *recvd = NULL;
ret = PW_USER_REQUEST;
else if (discon_reason == REASON_SERVER_DISCONNECT)
ret = PW_ADMIN_RESET;
else if (discon_reason == REASON_TIMEOUT)
ret = PW_ACCT_IDLE_TIMEOUT;
else
ret = PW_LOST_CARRIER;
if (rc_avpair_add(rh, &send, PW_ACCT_TERMINATE_CAUSE, &ret, -1, 0) == NULL) {

View File

@@ -108,6 +108,7 @@ extern int syslog_open;
#define REASON_ANY 1
#define REASON_USER_DISCONNECT 2
#define REASON_SERVER_DISCONNECT 3
#define REASON_TIMEOUT 4
#define ERR_SUCCESS 0
#define ERR_BAD_COMMAND -2

View File

@@ -774,7 +774,7 @@ int periodic_check(worker_st * ws, unsigned mtu_overhead, time_t now,
if (now - ws->last_msg_tcp > DPD_MAX_TRIES * dpd) {
oclog(ws, LOG_ERR,
"have not received TCP DPD for very long; tearing down connection");
return -1;
exit_worker_reason(ws, REASON_TIMEOUT);
}
}