]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix XSK-enabled check when reconnecting a backend 13914/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 14 Mar 2024 09:20:08 +0000 (10:20 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 14 Mar 2024 09:20:08 +0000 (10:20 +0100)
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

index 9c5da43e563554c4c8a950d9f4ba789fc2d8234a..a8f43b02643f4e7ae44f486d1e15582f9487185f 100644 (file)
@@ -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 */