ing
This commit is contained in:
parent
2f57a0975f
commit
f53c8f4117
|
@ -5,11 +5,11 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DiscoverGateway() (net.IP, string, error) {
|
func DiscoverGateway() (ip net.IP, iface string, err error) {
|
||||||
routeCmd := exec.Command("netstat", "-rn")
|
routeCmd := exec.Command("netstat", "-rn")
|
||||||
output, err := routeCmd.CombinedOutput()
|
output, err := routeCmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return parseDarwinRouteGet(output)
|
return parseDarwinRouteGet(output)
|
||||||
|
|
|
@ -9,7 +9,7 @@ func DiscoverGateway() (ip net.IP, iface string, err error) {
|
||||||
routeCmd := exec.Command("netstat", "-rn")
|
routeCmd := exec.Command("netstat", "-rn")
|
||||||
output, err := routeCmd.CombinedOutput()
|
output, err := routeCmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return parseBSDSolarisNetstat(output)
|
return parseBSDSolarisNetstat(output)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user