ref: 78eff200d85e0fc2f92622d221c0e3d81aaf9522
parent: 466cf20d3524b8e42edc333a6d2df2a01e99a95b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Oct 30 17:43:00 EDT 2023
ndb/dns: implement EDNS(0) extension (rfc6891) To properly handle TCP fallback for servers, we have to avoid sending responses too big for the client to accept. We used to accept up to 8K of UDP requests (and responses when resolving). Instead, we now advertise a UDP response size of 1232 (assuming 1280 MTU) to the client and take even smaller values into account from clients (tho not smaller than 512). This makes sure we truncate packets, signaling the client that it must retry with TCP. Note that we still accept up to 8K of UDP data regardless (for lucky clients).