From: Andre Noll Date: Sun, 8 Sep 2013 05:21:22 +0000 (+0000) Subject: net: Let makesock() continue on setsockopt() failure. X-Git-Tag: v0.5.2~11^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6ac9ff30a69753606cc76913515ae34f5ce2868d;ds=inline 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. --- 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);