]> git.ipfire.org Git - thirdparty/bind9.git/commit
Ensure server-specific "edns-udp-size" is obeyed
authorMichał Kępień <michal@isc.org>
Mon, 25 May 2020 12:34:56 +0000 (14:34 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 25 May 2020 12:34:56 +0000 (14:34 +0200)
commitd27f96cc98094cb44af0d03a2ed6d7238c9c2f8e
treebd0bd7ddf0b4dd07ba6f2c0c398ae3f1fa6bf5ad
parentd7583e7926e317c1eeacd695eca6fb3ad661a8af
Ensure server-specific "edns-udp-size" is obeyed

If "edns-udp-size" is set in a "server" block matching the queried
server, it is accounted for in the process of determining the advertised
UDP buffer size, but its value may still be overridden before the query
is sent.  This behavior contradicts the ARM which claims that when set,
the server-specific "edns-udp-size" value is used for all EDNS queries
sent to a given server.

Furthermore, calling dns_peer_getudpsize() with the "udpsize" variable
as an argument makes the code hard to follow as that call may either
update the value of "udpsize" or leave it untouched.

Ensure the code matches the documentation by moving the
dns_peer_getudpsize() call below all other blocks of code potentially
affecting the advertised UDP buffer size, which is where it was located
when server-specific "edns-udp-size" support was first implemented [1].
Improve code readability by calling dns_peer_getudpsize() with a helper
variable instead of "udpsize".

[1] see commit 1c153afce556ff3c687986fb7c4a0b0a7f5e7cd8
doc/arm/reference.rst
lib/dns/resolver.c