Compute EDNS(0) "Padding" option size
In order to calculate the number of octets to pad, we need to know the size of the DNS query so far. We use dnspython to generate the wire query and get its length. We add an EDNS(0) field so we have to add 4 octets which are the size of the Option code and the Option length. Then we can calculate the number of octets to pad based on the Block-length strategy (using 128 octets block size). See RFC 7830 and 8467.
Showing with 13 additions and 3 deletions