mirror of
https://github.com/soypat/lneto.git
synced 2026-08-31 20:09:05 +00:00
fix(dns): resolve CNAME chains and prevent invalid IP parsing
- Add automated in-band CNAME chain resolution to extract final A/AAAA IP addresses. - Replace `MaxResponseAnswers` with `MaxIPs` and `MaxCNAMEs` to explicitly bound resource decoding and prevent memory exhaustion. - Bound CNAME chain traversal to prevent infinite loops from cyclic records.
This commit is contained in:
@@ -629,8 +629,8 @@ func (s *StackAsync) StartLookupIPType(host string, qtype dns.Type) error {
|
||||
Additional: []dns.Resource{
|
||||
s.ednsopt,
|
||||
},
|
||||
EnableRecursion: true,
|
||||
MaxResponseAnswers: uint16(len(s.addrbufnip)),
|
||||
EnableRecursion: true,
|
||||
MaxIPs: uint16(len(s.addrbufnip)),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user