From c30a3aaa273143aa2617bd167ebc957462af88dd Mon Sep 17 00:00:00 2001 From: Leo Antunes Date: Thu, 30 Jun 2022 23:22:25 +0200 Subject: [PATCH] fix: ignore existing routes --- wg/wireguard.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wg/wireguard.go b/wg/wireguard.go index efcb45a..4f4d8d2 100644 --- a/wg/wireguard.go +++ b/wg/wireguard.go @@ -1,6 +1,7 @@ package wg import ( + "errors" "fmt" "hash/fnv" "net" @@ -140,7 +141,7 @@ func (s *State) SetUpInterface(nodes []common.Node) error { LinkIndex: link.Attrs().Index, Dst: addrToIPNet(node.OverlayAddr), Scope: netlink.SCOPE_LINK, - }); err != nil { + }); err != nil && !errors.Is(err, os.ErrExist) { return fmt.Errorf("adding route %s to %s: %w", node.OverlayAddr, s.iface, err) } }