Merge pull request #259 from mrunalp/fix_parse_ip_rc
Fix the return code check for ParseIP.
This commit is contained in:
commit
e48d21cf3c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue