Merge pull request #125 from okmeter/fix_net_io_counters_freebsd

[net] fix panic on freebsd (netstat error with exit code 0)
This commit is contained in:
shirou 2015-12-12 21:55:18 +09:00
commit 76c6e2ccc8
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
}
exists = append(exists, values[0])
if len(values) < 12 {
continue
}
base := 1
// sometimes Address is ommitted
if len(values) < 13 {