Clean up code determining advertised EDNS UDP buffer size
While looking at some packet captures, I noticed what looked like
oddities in how named
sets the advertised UDP buffer size in the EDNS
queries it sends to servers which have intermittent network issues. In
the end, I did not find any obvious bugs, but I believe the
documentation does not match the code in a few places and it also
occurred to me that the code determining the advertised UDP buffer
size in outgoing queries is cryptic enough for me to be unable to
predict what the outcome will be in pretty much any scenario.
I think it would be nice to rip out the redundant bits, add comments, and make sure the documentation matches the code (either by updating the former or fixing the latter). Such changes would likely not need to be backported to 9.16 (and beyond).
This is not particularly urgent, though it is slightly related to DNS Flag Day 2020.