From: FredericDT Date: Wed, 31 Aug 2022 09:53:47 +0000 (+0800) Subject: Not saving ComboAddress d_local in class TeeAction this time X-Git-Tag: rec-4.8.0-alpha1~36^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7bf9ae833f4de1be3a6fe9374f13880678e9ffb;p=thirdparty%2Fpdns.git 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 --- 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);