The reserved size in packet is a messy thing, broken by
https://gitlab.nic.cz/knot/knot-dns/-/commit/
ded5fbf01d00a875f141
Fortunately this function is trivial, so we can inline what we need.
It gets complicated by an earlier typo fix, though.
- fix unusual timestamp format in debug dumps of records (!1386)
- adjust linker options; it should help less common platforms (!1384)
- hints module: fix names inside home.arpa. (!1406)
+- EDNS padding (RFC 8467) compatibility with knot-dns 3.3 libs (!1422)
Knot Resolver 5.6.0 (2023-01-26)
int32_t pad_bytes = -1;
if (padding == -1) { /* use the default padding policy from libknot */
- pad_bytes = knot_pkt_default_padding_size(packet, opt_rr);
+ const size_t block_size = knot_wire_get_qr(packet->wire)
+ ? KNOT_EDNS_ALIGNMENT_RESPONSE_DEFAULT
+ #if KNOT_VERSION_HEX < 0x030200
+ : KNOT_EDNS_ALIGNMENT_QUERY_DEFALT;
+ #else
+ : KNOT_EDNS_ALIGNMENT_QUERY_DEFAULT;
+ #endif
+ pad_bytes = knot_edns_alignment_size(packet->size, knot_rrset_size(opt_rr),
+ block_size);
}
if (padding >= 2) {
int32_t max_pad_bytes = knot_edns_get_payload(opt_rr) - (packet->size + knot_rrset_size(opt_rr));