From f7bf9ae833f4de1be3a6fe9374f13880678e9ffb Mon Sep 17 00:00:00 2001 From: FredericDT Date: Wed, 31 Aug 2022 17:53:47 +0800 Subject: [PATCH] Not saving ComboAddress d_local in class TeeAction this time Accoding to https://github.com/PowerDNS/pdns/pull/11889 > rgacogne > Since we only use the local address in the constructor, I don't think we need to keep it around? > > FredericDT > Possibly using that d_local in statistical function? > > rgacogne > I would prefer not keeping it for now, we can always add it back later when we actually decide to do something with it :) Signed-off-by: FredericDT --- pdns/dnsdist-lua-actions.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pdns/dnsdist-lua-actions.cc b/pdns/dnsdist-lua-actions.cc index 637e5fc109..207058bdb2 100644 --- a/pdns/dnsdist-lua-actions.cc +++ b/pdns/dnsdist-lua-actions.cc @@ -135,7 +135,6 @@ public: private: ComboAddress d_remote; - boost::optional d_local; std::thread d_worker; void worker(); @@ -157,12 +156,12 @@ private: }; TeeAction::TeeAction(const ComboAddress& rca, const boost::optional& lca, bool addECS) - : d_remote(rca), d_local(lca), d_addECS(addECS) + : d_remote(rca), d_addECS(addECS) { d_fd=SSocket(d_remote.sin4.sin_family, SOCK_DGRAM, 0); try { - if (d_local) { - SBind(d_fd, *d_local); + if (lca) { + SBind(d_fd, *lca); } SConnect(d_fd, d_remote); setNonBlocking(d_fd); -- 2.47.2