TCP padding must stay within 1..256, including the 0x80 delimiter
dnsdist drops queries with more. The minimal padding is 1..64 bytes, so adding 0 to 3 random blocks of 64 bytes keeps it in range. Fixes #3368
This commit is contained in:
parent
121cf7871e
commit
7019609060
1 changed files with 1 additions and 1 deletions
|
|
@ -188,7 +188,7 @@ func (proxy *Proxy) Encrypt(
|
|||
if _, err := crypto_rand.Read(xpad[:]); err != nil {
|
||||
return nil, nil, nil, queryEpoch, err
|
||||
}
|
||||
minQuestionSize += int(xpad[0])
|
||||
minQuestionSize += int(xpad[0]&3) * 64
|
||||
}
|
||||
paddedLength := Min(MaxDNSUDPPacketSize, (Max(minQuestionSize, QueryOverhead)+1+63) & ^63)
|
||||
if serverInfo.knownBugs.fragmentsBlocked && proto == "udp" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue