fix(netlink): RouteList list routes from all tables

- Do not filter by link anymore
- IPv6 detection simplified
This commit is contained in:
Quentin McGaw
2023-06-08 09:12:46 +00:00
parent c58d6d4de2
commit 40cdb4f662
12 changed files with 43 additions and 48 deletions

View File

@@ -14,7 +14,7 @@ var (
)
func (r *Routing) VPNDestinationIP() (ip netip.Addr, err error) {
routes, err := r.netLinker.RouteList(nil, netlink.FamilyAll)
routes, err := r.netLinker.RouteList(netlink.FamilyAll)
if err != nil {
return ip, fmt.Errorf("listing routes: %w", err)
}
@@ -42,7 +42,7 @@ func (r *Routing) VPNDestinationIP() (ip netip.Addr, err error) {
}
func (r *Routing) VPNLocalGatewayIP(vpnIntf string) (ip netip.Addr, err error) {
routes, err := r.netLinker.RouteList(nil, netlink.FamilyAll)
routes, err := r.netLinker.RouteList(netlink.FamilyAll)
if err != nil {
return ip, fmt.Errorf("listing routes: %w", err)
}