Add custom prefix support in EDNS0 client subnet options

This commit is contained in:
世界 2024-05-12 15:06:21 +08:00
parent 0e120f8a44
commit da9e22b4e6
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
15 changed files with 96 additions and 41 deletions

View file

@ -27,7 +27,7 @@ import (
"github.com/sagernet/sing-box/outbound"
"github.com/sagernet/sing-box/transport/fakeip"
"github.com/sagernet/sing-dns"
mux "github.com/sagernet/sing-mux"
"github.com/sagernet/sing-mux"
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing-vmess"
"github.com/sagernet/sing/common"
@ -235,7 +235,7 @@ func NewRouter(
return nil, E.New("parse dns server[", tag, "]: missing address_resolver")
}
}
var clientSubnet netip.Addr
var clientSubnet netip.Prefix
if server.ClientSubnet != nil {
clientSubnet = server.ClientSubnet.Build()
} else if dnsOptions.ClientSubnet != nil {