chore(all): replace net.IP with netip.Addr
This commit is contained in:
@@ -2,14 +2,13 @@ package routing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/netip"
|
||||
"strconv"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/netlink"
|
||||
)
|
||||
|
||||
func (r *Routing) addRouteVia(destination netip.Prefix, gateway net.IP,
|
||||
func (r *Routing) addRouteVia(destination netip.Prefix, gateway netip.Addr,
|
||||
iface string, table int) error {
|
||||
destinationStr := destination.String()
|
||||
r.logger.Info("adding route for " + destinationStr)
|
||||
@@ -25,7 +24,7 @@ func (r *Routing) addRouteVia(destination netip.Prefix, gateway net.IP,
|
||||
|
||||
route := netlink.Route{
|
||||
Dst: NetipPrefixToIPNet(&destination),
|
||||
Gw: gateway,
|
||||
Gw: gateway.AsSlice(),
|
||||
LinkIndex: link.Attrs().Index,
|
||||
Table: table,
|
||||
}
|
||||
@@ -37,7 +36,7 @@ func (r *Routing) addRouteVia(destination netip.Prefix, gateway net.IP,
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Routing) deleteRouteVia(destination netip.Prefix, gateway net.IP,
|
||||
func (r *Routing) deleteRouteVia(destination netip.Prefix, gateway netip.Addr,
|
||||
iface string, table int) (err error) {
|
||||
destinationStr := destination.String()
|
||||
r.logger.Info("deleting route for " + destinationStr)
|
||||
@@ -53,7 +52,7 @@ func (r *Routing) deleteRouteVia(destination netip.Prefix, gateway net.IP,
|
||||
|
||||
route := netlink.Route{
|
||||
Dst: NetipPrefixToIPNet(&destination),
|
||||
Gw: gateway,
|
||||
Gw: gateway.AsSlice(),
|
||||
LinkIndex: link.Attrs().Index,
|
||||
Table: table,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user