]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RADIUS client: Print a clear debug log entry if socket is not available
authorJouni Malinen <j@w1.fi>
Sun, 23 Nov 2014 15:06:24 +0000 (17:06 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Nov 2014 15:41:13 +0000 (17:41 +0200)
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>
src/radius/radius_client.c

index e2766e2fe14c267bf6c143174bdbbbd93cfc5116..1382c53b17fb47d4e46c991f23b60fc5bd071fc8 100644 (file)
@@ -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: