mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-03 14:26:40 +00:00
TUN inbound: Rename to autoSystemWfpBlockLeak and autoSystemDnsToGateway
autoSystemWFP becomes autoSystemWfpBlockLeak, saying that the WFP filters block leaks, and autoSystemDNS becomes autoSystemDnsToGateway, saying where it points the system DNS, so that pointing the system DNS at the gateway on Windows later would fit the same name. Their config fields keep their numbers; neither was released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
63de6135cb
commit
4ec4fb8aab
+4
-4
@@ -20,8 +20,8 @@ type TunConfig struct {
|
||||
UserLevel uint32 `json:"userLevel"`
|
||||
AutoSystemRoutingTable []string `json:"autoSystemRoutingTable"`
|
||||
AutoOutboundsInterface *string `json:"autoOutboundsInterface"`
|
||||
AutoSystemDNS bool `json:"autoSystemDNS"`
|
||||
AutoSystemWFP bool `json:"autoSystemWFP"`
|
||||
AutoSystemDnsToGateway bool `json:"autoSystemDnsToGateway"`
|
||||
AutoSystemWfpBlockLeak bool `json:"autoSystemWfpBlockLeak"`
|
||||
}
|
||||
|
||||
func (v *TunConfig) Build() (proto.Message, error) {
|
||||
@@ -33,8 +33,8 @@ func (v *TunConfig) Build() (proto.Message, error) {
|
||||
DNS: v.DNS,
|
||||
UserLevel: v.UserLevel,
|
||||
AutoSystemRoutingTable: v.AutoSystemRoutingTable,
|
||||
AutoSystemDns: v.AutoSystemDNS,
|
||||
AutoSystemWfp: v.AutoSystemWFP,
|
||||
AutoSystemDnsToGateway: v.AutoSystemDnsToGateway,
|
||||
AutoSystemWfpBlockLeak: v.AutoSystemWfpBlockLeak,
|
||||
}
|
||||
if v.AutoOutboundsInterface != nil {
|
||||
config.AutoOutboundsInterface = *v.AutoOutboundsInterface
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/xtls/xray-core/proxy/tun"
|
||||
)
|
||||
|
||||
func TestTunConfigAutoSystemWFP(t *testing.T) {
|
||||
func TestTunConfigAutoSystem(t *testing.T) {
|
||||
creator := func() Buildable {
|
||||
return new(TunConfig)
|
||||
}
|
||||
@@ -19,9 +19,14 @@ func TestTunConfigAutoSystemWFP(t *testing.T) {
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500},
|
||||
},
|
||||
{
|
||||
Input: `{"name": "xray0", "autoSystemWFP": true}`,
|
||||
Input: `{"name": "xray0", "autoSystemDnsToGateway": true}`,
|
||||
Parser: loadJSON(creator),
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, AutoSystemWfp: true},
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, AutoSystemDnsToGateway: true},
|
||||
},
|
||||
{
|
||||
Input: `{"name": "xray0", "autoSystemWfpBlockLeak": true}`,
|
||||
Parser: loadJSON(creator),
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, AutoSystemWfpBlockLeak: true},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user