mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-10 17:45:41 +00:00
TUN inbound: Make strictRoute false by default
Like sing-box's strict_route, strictRoute is now false by default, so the Windows Filtering Platform filters are only added when it is set to true (together with autoSystemRoutingTable). With unset meaning false, strict_route becomes a plain bool field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2db099b34b
commit
eb29a4e3de
+1
-1
@@ -21,7 +21,7 @@ type TunConfig struct {
|
||||
AutoSystemRoutingTable []string `json:"autoSystemRoutingTable"`
|
||||
AutoOutboundsInterface *string `json:"autoOutboundsInterface"`
|
||||
AutoSystemDNS bool `json:"autoSystemDNS"`
|
||||
StrictRoute *bool `json:"strictRoute"`
|
||||
StrictRoute bool `json:"strictRoute"`
|
||||
}
|
||||
|
||||
func (v *TunConfig) Build() (proto.Message, error) {
|
||||
|
||||
@@ -11,7 +11,6 @@ func TestTunConfigStrictRoute(t *testing.T) {
|
||||
creator := func() Buildable {
|
||||
return new(TunConfig)
|
||||
}
|
||||
enabled, disabled := true, false
|
||||
|
||||
runMultiTestCase(t, []TestCase{
|
||||
{
|
||||
@@ -19,15 +18,10 @@ func TestTunConfigStrictRoute(t *testing.T) {
|
||||
Parser: loadJSON(creator),
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500},
|
||||
},
|
||||
{
|
||||
Input: `{"name": "xray0", "strictRoute": false}`,
|
||||
Parser: loadJSON(creator),
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, StrictRoute: &disabled},
|
||||
},
|
||||
{
|
||||
Input: `{"name": "xray0", "strictRoute": true}`,
|
||||
Parser: loadJSON(creator),
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, StrictRoute: &enabled},
|
||||
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, StrictRoute: true},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user