aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius/radius_client.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-05-30 08:33:01 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-30 15:08:37 (GMT)
commit9ed40766735a9628cc6c936076b175e6f66534bb (patch)
treeb21ddfcf44317361f9f01d7ad873a2318d039bc9 /src/radius/radius_client.c
parentcc0b7cb188b3729eb8b9769755aa31d8dc4f34cd (diff)
downloadhostap-9ed40766735a9628cc6c936076b175e6f66534bb.zip
hostap-9ed40766735a9628cc6c936076b175e6f66534bb.tar.gz
hostap-9ed40766735a9628cc6c936076b175e6f66534bb.tar.bz2
RADIUS client: Do not try to send message without socket
It is possible for the RADIUS authentication/accounting socket to not be open even if partial RADIUS server configuration has been done through the control interface SET commands. Previously, this resulted in send() attempt using fd=-1 which fails with bad file descriptor. Clean this up by logging this as a missing configuration instead of trying to send the message when that is known to fail. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius/radius_client.c')
-rw-r--r--src/radius/radius_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index 7625996..5199da7 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -633,7 +633,7 @@ int radius_client_send(struct radius_client_data *radius,
}
if (msg_type == RADIUS_ACCT || msg_type == RADIUS_ACCT_INTERIM) {
- if (conf->acct_server == NULL) {
+ if (conf->acct_server == NULL || radius->acct_sock < 0) {
hostapd_logger(radius->ctx, NULL,
HOSTAPD_MODULE_RADIUS,
HOSTAPD_LEVEL_INFO,
@@ -647,7 +647,7 @@ int radius_client_send(struct radius_client_data *radius,
s = radius->acct_sock;
conf->acct_server->requests++;
} else {
- if (conf->auth_server == NULL) {
+ if (conf->auth_server == NULL || radius->auth_sock < 0) {
hostapd_logger(radius->ctx, NULL,
HOSTAPD_MODULE_RADIUS,
HOSTAPD_LEVEL_INFO,