From bb218803ee8348a4ce9cd11b97681d6eba4082cf Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 14 Mar 2024 10:20:08 +0100 Subject: [PATCH] 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. --- pdns/dnsdistdist/dnsdist-backend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.47.2