From e20647954aedf1ceb4bb73ffcd506ad19413e41f Mon Sep 17 00:00:00 2001 From: mzz2017 Date: Wed, 29 Sep 2021 17:23:30 +0800 Subject: [PATCH] fix: some ipv6 inbounds has no routing in some cases --- service/core/v2ray/v2rayTmpl.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/core/v2ray/v2rayTmpl.go b/service/core/v2ray/v2rayTmpl.go index b3a7fe7c..540a5a6b 100644 --- a/service/core/v2ray/v2rayTmpl.go +++ b/service/core/v2ray/v2rayTmpl.go @@ -906,12 +906,13 @@ func (t *Template) setDualStack(setting *configure.Setting) { for i := range t.Routing.Rules { tag6 := make([]string, 0) for j, tag := range t.Routing.Rules[i].InboundTag { + tag := strings.TrimSuffix(tag, tag4Suffix) if _, ok := tagMap[tag]; ok { - t.Routing.Rules[i].InboundTag[j] += tag4Suffix + t.Routing.Rules[i].InboundTag[j] = tag + tag4Suffix tag6 = append(tag6, tag+tag6Suffix) } } - if len(tag6) > 0 && iptables.IsIPv6Supported() { + if v6supported := iptables.IsIPv6Supported(); len(tag6) > 0 && v6supported { t.Routing.Rules[i].InboundTag = append(t.Routing.Rules[i].InboundTag, tag6...) } }