Add IPv6 happy eyeball support for wireguard

(mostly vibe coded)
This commit is contained in:
Shelikhoo
2026-02-20 11:43:33 +00:00
committed by Xiaokang Wang (Shelikhoo)
parent 4c87c9f14f
commit f516eca541
6 changed files with 205 additions and 36 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ func (w *WrappedStack) createStack(linkedEndpoint stack.LinkEndpoint) (*stack.St
// Add protocol addresses
for _, ip := range w.config.Ips {
tcpIPAddr := tcpip.AddrFrom4Slice(ip.Ip)
tcpIPAddr := tcpip.AddrFromSlice(ip.Ip)
protocolAddress := tcpip.ProtocolAddress{
AddressWithPrefix: tcpip.AddressWithPrefix{
Address: tcpIPAddr,
@@ -114,7 +114,7 @@ func (w *WrappedStack) createStack(linkedEndpoint stack.LinkEndpoint) (*stack.St
s.SetRouteTable(func() (table []tcpip.Route) {
for _, cidrs := range w.config.Routes {
subnet := tcpip.AddressWithPrefix{
Address: tcpip.AddrFrom4Slice(cidrs.Ip),
Address: tcpip.AddrFromSlice(cidrs.Ip),
PrefixLen: int(cidrs.Prefix),
}.Subnet()
route := tcpip.Route{