Browse Source

tweak dns options

Darien Raymond 7 năm trước cách đây
mục cha
commit
463a9cbef8
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      app/dns/udpns.go

+ 4 - 3
app/dns/udpns.go

@@ -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)