hotfix(routing): detect vpn local gateway with new routes listing

This commit is contained in:
Quentin McGaw
2024-08-25 07:01:33 +00:00
parent ff7cadb43b
commit 01fa9934bc

View File

@@ -31,7 +31,7 @@ func (r *Routing) VPNLocalGatewayIP(vpnIntf string) (ip netip.Addr, err error) {
}
switch {
case route.Dst.IsValid() && route.Dst.Addr().IsUnspecified(): // OpenVPN
case route.Dst.IsValid() && route.Dst.Addr().IsUnspecified() && route.Gw.IsValid(): // OpenVPN
return route.Gw, nil
case route.Dst.IsSingleIP() &&
route.Dst.Addr().Compare(route.Src) == 0 &&