Add a fix for gw ip
This commit is contained in:
@@ -22,6 +22,10 @@ func via(dest net.IP) (net.IP, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Failed to execute command: %s", cmd)
|
return nil, fmt.Errorf("Failed to execute command: %s", cmd)
|
||||||
}
|
}
|
||||||
|
if string(out) == "" {
|
||||||
|
// assume the provided dest is the next hop
|
||||||
|
return dest, nil
|
||||||
|
}
|
||||||
return net.ParseIP(strings.TrimSpace(string(out))), nil
|
return net.ParseIP(strings.TrimSpace(string(out))), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user