mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-10 05:18:15 +03:00
Fix parsing A records
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
"github.com/sagernet/sing/common/json"
|
||||
"github.com/sagernet/sing/common/json/badoption"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
@@ -135,6 +136,9 @@ func (o *DNSRecordOptions) UnmarshalJSON(data []byte) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if a, isA := record.(*dns.A); isA {
|
||||
a.A = M.AddrFromIP(a.A).Unmap().AsSlice()
|
||||
}
|
||||
o.RR = record
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user