aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-05-30 17:52:08 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-30 17:52:08 (GMT)
commitb5239736117b5f4af9d949bbd3cc7e98721dfcd7 (patch)
tree46a664a34fafe1b6c95e937bf3eaf6d0c3588f96 /src/radius
parent09844c09843bda15759e258d9ac6377346446454 (diff)
downloadhostap-b5239736117b5f4af9d949bbd3cc7e98721dfcd7.zip
hostap-b5239736117b5f4af9d949bbd3cc7e98721dfcd7.tar.gz
hostap-b5239736117b5f4af9d949bbd3cc7e98721dfcd7.tar.bz2
RADIUS client: Trigger failover more quickly if socket is not valid
It is possible for the connect() call to fail (e.g., due to unreachable network based on local routing table), so the current auth/acct_sock may be left to -1. Use that as an addition trigger to allow server failover operation to be performed more quickly if it is known that the retransmission attempt will not succeed anyway. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index a7f1115..10056a6 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -390,6 +390,7 @@ static void radius_client_timer(void *eloop_ctx, void *timeout_ctx)
int auth_failover = 0, acct_failover = 0;
char abuf[50];
size_t prev_num_msgs;
+ int s;
entry = radius->msgs;
if (!entry)
@@ -423,7 +424,10 @@ static void radius_client_timer(void *eloop_ctx, void *timeout_ctx)
continue;
}
- if (entry->attempts > RADIUS_CLIENT_NUM_FAILOVER) {
+ s = entry->msg_type == RADIUS_AUTH ? radius->auth_sock :
+ radius->acct_sock;
+ if (entry->attempts > RADIUS_CLIENT_NUM_FAILOVER ||
+ (s < 0 && entry->attempts > 0)) {
if (entry->msg_type == RADIUS_ACCT ||
entry->msg_type == RADIUS_ACCT_INTERIM)
acct_failover++;