aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-11-23 15:06:24 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-23 15:41:13 (GMT)
commitb81e274cdf72a0a21ba44572775db4072d8cad2a (patch)
tree9ea0086d9d04da59f9dab6855bab390580a4f677 /src/radius
parentf931374f301dd16f4fce39db0fc330cb21a679f8 (diff)
downloadhostap-b81e274cdf72a0a21ba44572775db4072d8cad2a.zip
hostap-b81e274cdf72a0a21ba44572775db4072d8cad2a.tar.gz
hostap-b81e274cdf72a0a21ba44572775db4072d8cad2a.tar.bz2
RADIUS client: Print a clear debug log entry if socket is not available
It could have been possible to select a socket that is not open (sel_sock == -1) and try to use that in socket operations. This would fail with potentially confusing error messages. Make this clearer by printing a clear debug log entry on socket not being available. (CID 72696) Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index e2766e2..1382c53 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -1039,6 +1039,13 @@ radius_change_server(struct radius_client_data *radius,
return -1;
}
+ if (sel_sock < 0) {
+ wpa_printf(MSG_INFO,
+ "RADIUS: No server socket available (af=%d sock=%d sock6=%d auth=%d",
+ nserv->addr.af, sock, sock6, auth);
+ return -1;
+ }
+
if (conf->force_client_addr) {
switch (conf->client_addr.af) {
case AF_INET: