mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-26 21:16:57 +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
@@ -246,11 +246,10 @@ startOver:
|
||||
}
|
||||
}
|
||||
|
||||
// Once the system routes lead to the TUN, keep DNS if dns is set, and IPv6
|
||||
// if the TUN cannot carry it (no IPv6 address, or no IPv6 route to it),
|
||||
// from leaving through the other interfaces, unless strictRoute is off.
|
||||
strictRoute := t.options.StrictRoute == nil || *t.options.StrictRoute
|
||||
if blockDNS, blockIPv6 := len(dns) > 0, !address6 || !route6; strictRoute && (route4 || route6) && (blockDNS || blockIPv6) {
|
||||
// With strictRoute, once the system routes lead to the TUN, keep DNS if
|
||||
// dns is set, and IPv6 if the TUN cannot carry it (no IPv6 address, or no
|
||||
// IPv6 route to it), from leaving through the other interfaces.
|
||||
if blockDNS, blockIPv6 := len(dns) > 0, !address6 || !route6; t.options.StrictRoute && (route4 || route6) && (blockDNS || blockIPv6) {
|
||||
if t.wfp, err = blockLeaks(t.luid, blockDNS, blockIPv6); err != nil {
|
||||
what := "DNS and IPv6"
|
||||
if !blockIPv6 {
|
||||
|
||||
Reference in New Issue
Block a user