mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-02 05:46:39 +00:00
TUN inbound: Add autoSystemWfpBlockLeak on Windows (blocks "dns" and "misconfigtun" IPv4/IPv6 traffic leaks outside the TUN); Rename autoSystemDNS to autoSystemDnsToGateway on Linux (and change some behaviors) (#6853)
https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5899791359 https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5901287980 https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5903680113 https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5904123488 https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5904647772 https://github.com/XTLS/Xray-core/pull/6853#issuecomment-5905047424 Fixes https://github.com/XTLS/Xray-core/issues/6454#issuecomment-5863800676 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed by
RPRX
co-authored by
Claude Opus 5.5
parent
0086362663
commit
1f304916bd
@@ -166,12 +166,14 @@ func (t *Handler) Start() error {
|
||||
}
|
||||
|
||||
// Platform-specific system DNS takeover, where the platform implements it.
|
||||
// Non-fatal: a failure leaves DNS management with the OS.
|
||||
// Rather no TUN than one that the system DNS bypasses.
|
||||
if c, ok := tunInterface.(interface {
|
||||
ConfigureSystemDNS(context.Context, string) error
|
||||
}); ok {
|
||||
if err := c.ConfigureSystemDNS(t.ctx, t.tag); err != nil {
|
||||
errors.LogInfoInner(t.ctx, err, "[tun] system DNS not configured")
|
||||
_ = tunStack.Close()
|
||||
_ = tunInterface.Close()
|
||||
return errors.New("unable to set the system DNS (remove autoSystemDnsToGateway to run without)").Base(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user