Browse Source

WPS: Print setsockopt() failure in debug log

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen 11 years ago
parent
commit
27b418715f
1 changed files with 7 additions and 1 deletions
  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;