From 6ac9ff30a69753606cc76913515ae34f5ce2868d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 8 Sep 2013 05:21:22 +0000 Subject: [PATCH] net: Let makesock() continue on setsockopt() failure. If the setsockopt() call succeeds but the following bind() fails, we happily continue to process the address info structure. It seems wrong to abort the loop if setsockopt() could not enable SO_REUSEADDR. Just continue in this case. --- net.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net.c b/net.c index b7806a18..822f70de 100644 --- a/net.c +++ b/net.c @@ -443,11 +443,8 @@ static int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai, */ if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { - ret = -ERRNO_TO_PARA_ERROR(errno); close(sockfd); - PARA_ERROR_LOG("can not set SO_REUSEADDR: %s\n", - para_strerror(-ret)); - return ret; + continue; } if (bind(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) { close(sockfd); -- 2.39.5