Parcourir la source

WPS: Print setsockopt() failure in debug log

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen il y a 11 ans
Parent
commit
27b418715f
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      src/wps/http_server.c

+ 7 - 1
src/wps/http_server.c

@@ -244,7 +244,13 @@ struct http_server * http_server_init(struct in_addr *addr, int port,
 	if (srv->fd < 0)
 		goto fail;
 
-	setsockopt(srv->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+	if (setsockopt(srv->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
+	{
+		wpa_printf(MSG_DEBUG,
+			   "HTTP: setsockopt(SO_REUSEADDR) failed: %s",
+			   strerror(errno));
+		/* try to continue anyway */
+	}
 
 	if (fcntl(srv->fd, F_SETFL, O_NONBLOCK) < 0)
 		goto fail;