Skip to content

Commit

Permalink
Fixed routing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
UnAfraid committed Oct 22, 2023
1 parent b431920 commit 6393b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/wireguard/linux/backend_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func configureRoutes(name string, allowedIPs []net.IPNet) error {
}

for i, route := range routesToUpdate {
if err = netlink.RouteReplace(routesToAdd[i]); err != nil {
if err = netlink.RouteReplace(routesToUpdate[i]); err != nil {
return fmt.Errorf("failed to replace route for %s - %w", route.Dst.String(), err)
}

Expand All @@ -395,7 +395,7 @@ func configureRoutes(name string, allowedIPs []net.IPNet) error {
}

for i, route := range routesToRemove {
if err = netlink.RouteDel(routesToAdd[i]); err != nil {
if err = netlink.RouteDel(routesToRemove[i]); err != nil {
return fmt.Errorf("failed to delete route for %s - %w", route.Dst.String(), err)
}

Expand Down

0 comments on commit 6393b88

Please sign in to comment.