DNS: Retry with EDNS0 when response is truncated (#4516)

This commit is contained in:
风扇滑翔翼 authored and RPRX committed 2025-03-21 08:58:51 +00:00
1 parent 6f8e253dec
commit 86a225cda1
3 files changed
+49 -15

No files matched your search

+9 -7
View File
@@ -31,10 +31,11 @@ type record struct {
// IPRecord is a cacheable item for a resolved domain
type IPRecord struct {
ReqID uint16
IP []net.Address
Expire time.Time
RCode dnsmessage.RCode
ReqID uint16
IP []net.Address
Expire time.Time
RCode dnsmessage.RCode
RawHeader *dnsmessage.Header
}
func (r *IPRecord) getIPs() ([]net.Address, error) {
@@ -179,9 +180,10 @@ func parseResponse(payload []byte) (*IPRecord, error) {
now := time.Now()
ipRecord := &IPRecord{
ReqID: h.ID,
RCode: h.RCode,
Expire: now.Add(time.Second * 600),
ReqID: h.ID,
RCode: h.RCode,
Expire: now.Add(time.Second * 600),
RawHeader: &h,
}
L: