Merge pull request #259 from mrunalp/fix_parse_ip_rc

Fix the return code check for ParseIP.
This commit is contained in:
Michael Crosby 2014-11-10 10:40:39 -08:00
commit e48d21cf3c
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)