Skip to content

Commit

Permalink
fix: ignore existing routes
Browse files Browse the repository at this point in the history
  • Loading branch information
costela committed Jun 30, 2022
1 parent 24d3361 commit c30a3aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wg/wireguard.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package wg

import (
"errors"
"fmt"
"hash/fnv"
"net"
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit c30a3aa

Please sign in to comment.