From 3ba30e3f006bf0d90335d29cf07d09845a454073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 2 Feb 2026 17:29:21 +0800 Subject: [PATCH] Fix route_address_set duplicated IP sets causing route creation failure The FlatMap calls pre-populated routeAddressSet and routeExcludeAddressSet before the for-loops which appended the same IP sets again, doubling every entry. On Windows this caused CreateIpForwardEntry2 to return ERROR_OBJECT_ALREADY_EXISTS. Fixes #3725 --- protocol/tun/inbound.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/protocol/tun/inbound.go b/protocol/tun/inbound.go index ee85f80b..bfa19eaf 100644 --- a/protocol/tun/inbound.go +++ b/protocol/tun/inbound.go @@ -324,7 +324,6 @@ func (t *Inbound) Start(stage adapter.StartStage) error { t.tunOptions.Name = tun.CalculateInterfaceName("") } if t.platformInterface == nil { - t.routeAddressSet = common.FlatMap(t.routeRuleSet, adapter.RuleSet.ExtractIPSet) for _, routeRuleSet := range t.routeRuleSet { ipSets := routeRuleSet.ExtractIPSet() if len(ipSets) == 0 { @@ -336,7 +335,6 @@ func (t *Inbound) Start(stage adapter.StartStage) error { t.routeRuleSetCallback = append(t.routeRuleSetCallback, routeRuleSet.RegisterCallback(t.updateRouteAddressSet)) } } - t.routeExcludeAddressSet = common.FlatMap(t.routeExcludeRuleSet, adapter.RuleSet.ExtractIPSet) for _, routeExcludeRuleSet := range t.routeExcludeRuleSet { ipSets := routeExcludeRuleSet.ExtractIPSet() if len(ipSets) == 0 {