]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Really disable REUSEADDR on outgoing UDP client sockets 12824/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 15 May 2023 13:32:27 +0000 (15:32 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 15 May 2023 13:33:58 +0000 (15:33 +0200)
It turns out that our `Socket::bind()` will _helpfully_ enable this
by default.

(cherry picked from commit 20f67fee9447069d4586a41254468ac060b2d65e)

pdns/dnsdistdist/dnsdist-healthchecks.cc

index fc831e6481e94b051d45d652162a1fe12e46fd0c..ab147cb15014eb533b834c2f846523f04c237cf1 100644 (file)
@@ -327,7 +327,7 @@ bool queueHealthCheck(std::unique_ptr<FDMultiplexer>& mplexer, const std::shared
         SSetsockopt(sock.getHandle(), SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1);
       }
 #endif
-      sock.bind(ds->d_config.sourceAddr);
+      sock.bind(ds->d_config.sourceAddr, false);
     }
 
     auto data = std::make_shared<HealthCheckData>(*mplexer, ds, std::move(checkName), checkType, checkClass, queryID);