chore(netlink): define own types with minimal fields
- Allow to swap `github.com/vishvananda/netlink` - Allow to add build tags for each platform - One step closer to development on non-Linux platforms
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"net/netip"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/netlink"
|
||||
"github.com/qdm12/gluetun/internal/routing"
|
||||
)
|
||||
|
||||
func (w *Wireguard) addAddresses(link netlink.Link,
|
||||
@@ -15,15 +14,14 @@ func (w *Wireguard) addAddresses(link netlink.Link,
|
||||
continue
|
||||
}
|
||||
|
||||
ipNet := ipNet
|
||||
address := &netlink.Addr{
|
||||
IPNet: routing.NetipPrefixToIPNet(&ipNet),
|
||||
address := netlink.Addr{
|
||||
Network: ipNet,
|
||||
}
|
||||
|
||||
err = w.netlink.AddrReplace(link, address)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w: when adding address %s to link %s",
|
||||
err, address, link.Attrs().Name)
|
||||
err, address, link.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user