From 6f7adc79c8c6449eb97a62de974ba92f0264ebdb Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 10 Nov 2014 13:12:04 -0500 Subject: [PATCH] Fix the return code check for ParseIP. Signed-off-by: Mrunal Patel (github: mrunalp) --- netlink/netlink_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)