]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix wrong eBPF values (qtype, counter) being inserted for qnames 11565/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 20 Apr 2022 12:32:14 +0000 (14:32 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 20 Apr 2022 12:32:14 +0000 (14:32 +0200)
pdns/bpf-filter.cc

index d0ec0f617225f58cae9989bb2354fc18470fcf7f..877f5f8a46ba459aa7d11872ea8334edff32badb 100644 (file)
@@ -503,12 +503,11 @@ void BPFFilter::block(const DNSName& qname, BPFFilter::MatchAction action, uint1
       throw std::runtime_error("Table full when trying to block " + qname.toLogString());
     }
 
-    int res = bpf_lookup_elem(map.d_fd.getHandle(), &key, &value);
+    int res = bpf_lookup_elem(map.d_fd.getHandle(), &key, value);
     if (res != -1) {
       throw std::runtime_error("Trying to block an already blocked qname: " + qname.toLogString());
     }
-
-    res = bpf_update_elem(map.d_fd.getHandle(), &key, &value, BPF_NOEXIST);
+    res = bpf_update_elem(map.d_fd.getHandle(), &key, value, BPF_NOEXIST);
     if (res == 0) {
       ++map.d_count;
     }