Skip to content

Commit

Permalink
NET-1616:add fix for checking gateway issue (#881)
Browse files Browse the repository at this point in the history
* add fix for checking gateway issue

* fix ipv6 defaultgw issue
  • Loading branch information
yabinma committed Sep 17, 2024
1 parent 746f5a4 commit 7ed4cf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wireguard/wireguard_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func GetDefaultGateway() (gwRoute netlink.Route, err error) {

//get default gateway by filtering with dst==nil
for _, r := range routes {
if r.Dst == nil {
if r.Dst == nil || r.Dst.IP.Equal(net.ParseIP("0.0.0.0")) || r.Dst.IP.Equal(net.ParseIP("::")) {
gwRoutes = append(gwRoutes, r)
}
}
Expand Down

0 comments on commit 7ed4cf4

Please sign in to comment.