]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
axfr: split multi-mesage responses to 16kib -- compression
authorLibor Peltan <libor.peltan@nic.cz>
Mon, 7 Sep 2020 15:42:31 +0000 (17:42 +0200)
committerLibor Peltan <libor.peltan@nic.cz>
Wed, 9 Sep 2020 11:24:27 +0000 (13:24 +0200)
src/knot/nameserver/axfr.c

index a96f6d6d213e0c2a294c457587c0af55d8831bd2..410db295987e2976dcfefc992adbb7e47a185d55 100644 (file)
@@ -57,6 +57,12 @@ static int axfr_put_rrsets(knot_pkt_t *pkt, zone_node_t *node,
                        state->cur_rrset = i;
                        return ret;
                }
+               if (pkt->size > KNOT_WIRE_PTR_MAX) {
+                       // optimization: once the XFR DNS message is > 16 KiB, compression
+                       // is limited. Better wrap to next message.
+                       state->cur_rrset = i + 1;
+                       return KNOT_ESPACE;
+               }
        }
 
        state->cur_rrset = 0;