[client] Fix stale local records (#3776)

This commit is contained in:
Viktor Liu
2025-05-05 14:29:05 +02:00
committed by GitHub
parent ffdd115ded
commit 9762b39f29
13 changed files with 786 additions and 416 deletions

View File

@ -66,17 +66,17 @@ func (s SimpleRecord) String() string {
func (s SimpleRecord) Len() uint16 {
emptyString := s.RData == ""
switch s.Type {
case 1:
case int(dns.TypeA):
if emptyString {
return 0
}
return net.IPv4len
case 5:
case int(dns.TypeCNAME):
if emptyString || s.RData == "." {
return 1
}
return uint16(len(s.RData) + 1)
case 28:
case int(dns.TypeAAAA):
if emptyString {
return 0
}