]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to return formerr for queries for meta-types, to avoid
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 5 Jan 2017 08:14:34 +0000 (08:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 5 Jan 2017 08:14:34 +0000 (08:14 +0000)
  packet amplification if this meta-type is sent on to upstream.

git-svn-id: file:///svn/unbound/trunk@3978 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog

index 09a1465423f348e5ae9bb4c3daa79e219cb667d0..357d3e60d824a07c8c3306f7345734a7f27a87ad 100644 (file)
@@ -860,6 +860,23 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                }
                goto send_reply;
        }
+       if(qinfo.qtype == LDNS_RR_TYPE_OPT || 
+               qinfo.qtype == LDNS_RR_TYPE_TSIG ||
+               qinfo.qtype == LDNS_RR_TYPE_TKEY ||
+               qinfo.qtype == LDNS_RR_TYPE_MAILA ||
+               qinfo.qtype == LDNS_RR_TYPE_MAILB) {
+               verbose(VERB_ALGO, "worker request: formerror for meta-type.");
+               log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
+               sldns_buffer_rewind(c->buffer);
+               LDNS_QR_SET(sldns_buffer_begin(c->buffer));
+               LDNS_RCODE_SET(sldns_buffer_begin(c->buffer), 
+                       LDNS_RCODE_FORMERR);
+               if(worker->stats.extended) {
+                       worker->stats.qtype[qinfo.qtype]++;
+                       server_stats_insrcode(&worker->stats, c->buffer);
+               }
+               goto send_reply;
+       }
        if((ret=parse_edns_from_pkt(c->buffer, &edns, worker->scratchpad)) != 0) {
                struct edns_data reply_edns;
                verbose(VERB_ALGO, "worker parse edns: formerror.");
index 0a646e56124ba7dc565665ce1a8bc599b0daa083..b04aae73c36c9c83c182ab6bed3c404d95421958 100644 (file)
@@ -1,3 +1,7 @@
+5 January 2017: Wouter
+       - Fix to return formerr for queries for meta-types, to avoid
+         packet amplification if this meta-type is sent on to upstream.
+
 3 January 2017: Wouter
        - configure --enable-systemd and lets unbound use systemd sockets if
          you enable use-systemd: yes in unbound.conf.