fix: 修复 Windows 端 IPv6 无法下行的问题

根因: netsh interface ipv6 命令参数名用错
- configureIPv6Addr: name= → interface=,IPv6 地址未实际分配到适配器
- SetMTU IPv6: name= → interface=

路由修复:
- cidrToV6Prefix: 用 Mask.Size() 取前缀长度,修复 fmt.Sprintf(%d, mask) 输出字节切片的 bug
- addRoute6/deleteRoute6: netsh → route -6,用 :: 作 on-link gateway
- addRouteVia6/deleteRouteVia6: 加 -6 flag
- defaultGateway6: route -6 print :: → route -6 print(避免过滤掉 ::/0)
- applyFull: IPv6 bypass 路由失败不再阻断全隧道路由
This commit is contained in:
2026-07-07 17:37:09 +08:00
parent 65a5932eba
commit 0c5e996bfd
3 changed files with 19 additions and 19 deletions
+4 -2
View File
@@ -138,12 +138,14 @@ func (m *Manager) applyFull() error {
}
// Bypass: server's public IPv6 via the original v6 gateway.
// Non-fatal: if this fails, full-tunnel routes are still added.
if v6 != "" && gw6 != "" {
bypassSpec := v6 + "/128"
if err := addRouteVia6(bypassSpec, gw6); err != nil {
return fmt.Errorf("add server bypass6 route: %w", err)
m.serverBypass6 = false
} else {
m.serverBypass6 = true
}
m.serverBypass6 = true
}
// Two /1 routes cover the entire IPv4 space and are more specific