Fix link-local destinations rejected as TUN loopback

This commit is contained in:
世界
2026-11-09 14:37:27 +00:00
parent e3ca1835ae
commit 586b48065c
3 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -125,7 +125,12 @@ func (h *Outbound) fetchMyAddresses() {
continue
}
found = true
myAddresses = append(myAddresses, myInterface.Addresses...)
for _, prefix := range myInterface.Addresses {
if prefix.Addr().Is6() && prefix.Addr().IsLinkLocalUnicast() {
prefix = netip.PrefixFrom(prefix.Addr(), prefix.Addr().BitLen())
}
myAddresses = append(myAddresses, prefix)
}
}
if !found {
return