From 958d6a25a41dad7d7915cb24df534d1f65580981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 16 Nov 2023 18:21:03 +0800 Subject: [PATCH] Fix "Fix Linux IPv6 auto route rules" --- tun_linux.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tun_linux.go b/tun_linux.go index 4217548..718b445 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -573,6 +573,17 @@ func (t *NativeTun) rules() []*netlink.Rule { } if p6 { if !t.options.StrictRoute { + for _, address := range t.options.Inet6Address { + it = netlink.NewRule() + it.Priority = priority6 + it.IifName = "lo" + it.Src = address.Masked() + it.Table = t.options.TableIndex + it.Family = unix.AF_INET6 + rules = append(rules, it) + } + priority6++ + it = netlink.NewRule() it.Priority = priority6 it.IifName = "lo"