From b1c0882b47d1e0fbab4d76977175a8bb89380ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 16 Jan 2025 09:42:08 +0800 Subject: [PATCH] Revert "Set `route_exclude_address_set` for routing" This reverts commit e72f4526200462d9da78ae95274b139d7da575f7. --- template/render_inbounds.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/template/render_inbounds.go b/template/render_inbounds.go index 43313a4..237d8c3 100644 --- a/template/render_inbounds.go +++ b/template/render_inbounds.go @@ -29,7 +29,6 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options) autoRedirect := t.AutoRedirect && !metadata.Platform.IsApple() && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.2"))) - tunExclude := metadata.Platform != M.PlatformAndroid && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.11.0-beta.14"))) disableTun := t.DisableTUN && !metadata.Platform.TunOnly() if !disableTun { options.Route.AutoDetectInterface = true @@ -38,16 +37,18 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options) address = append(address, netip.MustParsePrefix("fdfe:dcba:9876::1/126")) } tunOptions := &option.TunInboundOptions{ - AutoRoute: true, - Address: address, - AutoRedirect: autoRedirect, + AutoRoute: true, + Address: address, } tunInbound := option.Inbound{ Type: C.TypeTun, Options: tunOptions, } - if tunExclude && !t.DisableTrafficBypass { - tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"} + if autoRedirect { + tunOptions.AutoRedirect = true + if !t.DisableTrafficBypass && metadata.Platform == "" { + tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"} + } } if metadata.Platform == M.PlatformUnknown { tunOptions.StrictRoute = true