From: Remi Gacogne Date: Thu, 14 Mar 2024 09:20:08 +0000 (+0100) Subject: dnsdist: Fix XSK-enabled check when reconnecting a backend X-Git-Tag: rec-5.1.0-alpha1~93^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb218803ee8348a4ce9cd11b97681d6eba4082cf;p=thirdparty%2Fpdns.git dnsdist: Fix XSK-enabled check when reconnecting a backend The check was reverted, meaning that we did not properly remove an address:port from the XSK map when reconnecting a backend, and actually tried to remove an entry from a non-existing map when XSK is compiled in but not enabled, triggering a: ``` Error getting the XSK destination addresses map path '/sys/fs/bpf/dnsdist/xsk-destinations-v4' ``` message. --- diff --git a/pdns/dnsdistdist/dnsdist-backend.cc b/pdns/dnsdistdist/dnsdist-backend.cc index 9c5da43e56..a8f43b0264 100644 --- a/pdns/dnsdistdist/dnsdist-backend.cc +++ b/pdns/dnsdistdist/dnsdist-backend.cc @@ -101,7 +101,7 @@ bool DownstreamState::reconnect(bool initialAttempt) (*mplexer.lock())->removeReadFD(fd); } #ifdef HAVE_XSK - if (d_xskInfos.empty()) { + if (!d_xskInfos.empty()) { removeXSKDestination(fd); } #endif /* HAVE_XSK */