Fix the return code check for ParseIP.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)
This commit is contained in:
Mrunal Patel 2014-11-10 13:12:04 -05:00
parent 4ae31b6ceb
commit 6f7adc79c8
1 changed files with 1 additions and 1 deletions

View File

@ -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)