From: Otto Moerbeek Date: Mon, 12 Dec 2022 19:03:04 +0000 (+0100) Subject: Fix compilation on FreeBSD. reported by HellSpawn X-Git-Tag: dnsdist-1.8.0-rc1~166^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=398bb0f1e7122d6de0e6c5ec3383ba49a446d580;p=thirdparty%2Fpdns.git Fix compilation on FreeBSD. reported by HellSpawn --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index ee826d784d..1b62d2db9b 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -2517,7 +2517,7 @@ void makeUDPServerSockets(deferredAdd_t& deferredAdds, Logr::log_t log) if (g_reusePort) { #if defined(SO_REUSEPORT_LB) try { - SSetsockopt(fd, SOL_SOCKET, SO_REUSEPORT_LB, 1); + SSetsockopt(socketFd, SOL_SOCKET, SO_REUSEPORT_LB, 1); } catch (const std::exception& e) { throw PDNSException(std::string("SO_REUSEPORT_LB: ") + e.what()); diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index e1bc143b6e..160fe98572 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -1067,7 +1067,7 @@ void makeTCPServerSockets(deferredAdd_t& deferredAdds, std::set& tcpSockets if (g_reusePort) { #if defined(SO_REUSEPORT_LB) try { - SSetsockopt(fd, SOL_SOCKET, SO_REUSEPORT_LB, 1); + SSetsockopt(socketFd, SOL_SOCKET, SO_REUSEPORT_LB, 1); } catch (const std::exception& e) { throw PDNSException(std::string("SO_REUSEPORT_LB: ") + e.what());