From a61133e30418f8f6f7db1498731b6fc493b1138d Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 12 Dec 2022 20:03:04 +0100 Subject: [PATCH] Fix compilation on FreeBSD. reported by HellSpawn (cherry picked from commit 398bb0f1e7122d6de0e6c5ec3383ba49a446d580) --- pdns/pdns_recursor.cc | 2 +- pdns/recursordist/rec-tcp.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()); -- 2.47.2