net: Change makesock_addrinfo() to set given flowopts before SO_REUSEADDR.
authorAndre Noll <maan@systemlinux.org>
Sun, 8 Sep 2013 04:33:29 +0000 (04:33 +0000)
committerAndre Noll <maan@systemlinux.org>
Wed, 1 Jan 2014 17:40:15 +0000 (17:40 +0000)
Should not matter but allows to combine the code that follows.

net.c

diff --git a/net.c b/net.c
index 5e4f131..a95f145 100644 (file)
--- a/net.c
+++ b/net.c
@@ -440,6 +440,7 @@ static int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai,
                if (ret < 0)
                        goto get_next_dst;
                sockfd = ret;
+               flowopt_setopts(sockfd, fo);
                /*
                 * Reuse the address on passive sockets to avoid failure on
                 * restart (protocols using listen()) and when creating
@@ -453,7 +454,6 @@ static int makesock_addrinfo(unsigned l4type, bool passive, struct addrinfo *ai,
                                para_strerror(-ret));
                        break;
                }
-               flowopt_setopts(sockfd, fo);
 
                if (passive) {
                        if (bind(sockfd, src->ai_addr, src->ai_addrlen) < 0) {