mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-15 19:41:02 +00:00
forgot this one in #2622
This commit is contained in:
@@ -190,16 +190,13 @@ func (r *Reporter) Report() (report.Report, error) {
|
||||
}
|
||||
|
||||
func getLocalIPs() ([]string, error) {
|
||||
addrs, err := net.InterfaceAddrs()
|
||||
ipnets, err := report.GetLocalNetworks()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ips := []string{}
|
||||
for _, addr := range addrs {
|
||||
// Not all addrs are IPNets.
|
||||
if ipNet, ok := addr.(*net.IPNet); ok {
|
||||
ips = append(ips, ipNet.IP.String())
|
||||
}
|
||||
for _, ipnet := range ipnets {
|
||||
ips = append(ips, ipnet.IP.String())
|
||||
}
|
||||
return ips, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user