]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Print setsockopt() failure in debug log
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 25 Apr 2014 20:14:24 +0000 (23:14 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 28 Apr 2014 13:54:09 +0000 (16:54 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/wps/http_server.c

index 06c8bee24c56f2830ae4bdb63838906440e758f9..ac088c429d606a0f8452ccc909969b49ef9d7add 100644 (file)
@@ -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;