diff --git a/netlink/netlink_linux.go b/netlink/netlink_linux.go index 57790421..851d959c 100644 --- a/netlink/netlink_linux.go +++ b/netlink/netlink_linux.go @@ -1004,7 +1004,7 @@ func AddRoute(destination, source, gateway, device string) error { if source != "" { srcIP := net.ParseIP(source) - if err != nil { + if srcIP == nil { return fmt.Errorf("source IP %s couldn't be parsed", source) } srcFamily := getIpFamily(srcIP)