|
|
|
@ -173,17 +173,18 @@ func (s *ClassicNameServer) getMsgOptions() *dns.OPT {
|
|
|
|
|
o := new(dns.OPT) |
|
|
|
|
o.Hdr.Name = "." |
|
|
|
|
o.Hdr.Rrtype = dns.TypeOPT |
|
|
|
|
o.SetUDPSize(1280) |
|
|
|
|
o.SetUDPSize(1350) |
|
|
|
|
|
|
|
|
|
e := new(dns.EDNS0_SUBNET) |
|
|
|
|
e.Code = dns.EDNS0SUBNET |
|
|
|
|
if len(s.clientIP) == 4 { |
|
|
|
|
e.Family = 1 // 1 for IPv4 source address, 2 for IPv6
|
|
|
|
|
e.Family = 1 // 1 for IPv4 source address, 2 for IPv6
|
|
|
|
|
e.SourceNetmask = 24 // 32 for IPV4, 128 for IPv6
|
|
|
|
|
} else { |
|
|
|
|
e.Family = 2 |
|
|
|
|
e.SourceNetmask = 96 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
e.SourceNetmask = 24 // 32 for IPV4, 128 for IPv6
|
|
|
|
|
e.SourceScope = 0 |
|
|
|
|
e.Address = s.clientIP |
|
|
|
|
o.Option = append(o.Option, e) |
|
|
|
|