[PATCH]: send errno EBADF handling

Ted Merrill ted at atheros.com
Tue Oct 9 19:36:58 EDT 2007


Jouni et al,

I'm starting with the possibly simplest (if least interesting)
fix of a number of fixes from Atheros... 
please let me know if i'm doing this in the right way to get this into the hostap mainline.
Thanks!

Regarding this fix:
The Atheros engineers were perhaps working around some sort of software bug? 
not clear if you'd get EBADF otherwise. 
Never the less, closing the socket (perhaps no affect if it was bogus fd)
and starting over is a not unreasonable recovery strategy...

Thanks again,
-Ted Merrill
Atheros Communications

The patch:

diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index 4996a17..9409b22 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -142,7 +142,7 @@ static void radius_client_handle_send_error(struct radius_client_data *radius,
 #ifndef CONFIG_NATIVE_WINDOWS
 	int _errno = errno;
 	perror("send[RADIUS]");
-	if (_errno == ENOTCONN || _errno == EDESTADDRREQ || _errno == EINVAL) {
+	if (_errno == ENOTCONN || _errno == EDESTADDRREQ || _errno == EINVAL || _errno == EBADF) {
 		hostapd_logger(radius->ctx, NULL, HOSTAPD_MODULE_RADIUS,
 			       HOSTAPD_LEVEL_INFO,
 			       "Send failed - maybe interface status changed -"



More information about the HostAP mailing list