aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-02-28 11:57:57 (GMT)
committerJouni Malinen <j@w1.fi>2015-02-28 13:45:17 (GMT)
commit94b39e5927e570e6b0fe41d455dde0a361c71c36 (patch)
tree60ac3e7b1e4b847030510b84f388ca5ec4003f39 /src/radius
parentbbee36e316186b53d5b9d97c2248f85120c40107 (diff)
downloadhostap-94b39e5927e570e6b0fe41d455dde0a361c71c36.zip
hostap-94b39e5927e570e6b0fe41d455dde0a361c71c36.tar.gz
hostap-94b39e5927e570e6b0fe41d455dde0a361c71c36.tar.bz2
RADIUS client: Fix server connection recovery after initial failure
If the initial attempt at opening the socket connection to the RADIUS server failed due to missing IP connectivity during startup, e.g., with "connect[radius]: Network is unreachable", hostapd did not try to reconnect when RADIUS messages were sent. Instead, it only reported "No authentication server configured" even if the configuration did have a server entry. This was broken by commit 9ed40766735a9628cc6c936076b175e6f66534bb ('RADIUS client: Do not try to send message without socket') for the initial case and the more recent fixes in RADIUS server failover cases did not cover the initial failure case. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index 34f5685..5c81cab 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -658,6 +658,9 @@ int radius_client_send(struct radius_client_data *radius,
}
if (msg_type == RADIUS_ACCT || msg_type == RADIUS_ACCT_INTERIM) {
+ if (conf->acct_server && radius->acct_sock < 0)
+ radius_client_init_acct(radius);
+
if (conf->acct_server == NULL || radius->acct_sock < 0 ||
conf->acct_server->shared_secret == NULL) {
hostapd_logger(radius->ctx, NULL,
@@ -673,6 +676,9 @@ int radius_client_send(struct radius_client_data *radius,
s = radius->acct_sock;
conf->acct_server->requests++;
} else {
+ if (conf->auth_server && radius->auth_sock < 0)
+ radius_client_init_auth(radius);
+
if (conf->auth_server == NULL || radius->auth_sock < 0 ||
conf->auth_server->shared_secret == NULL) {
hostapd_logger(radius->ctx, NULL,