diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2013-04-10 20:29:23 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2013-04-10 20:29:23 +0000 |
| commit | 29dde48df4d119ddbbe0cbd65c54819f86fd4779 (patch) | |
| tree | 60c79ab7327265f2bed643c9aafe36baf2ee239d /usr.bin/netstat/inet.c | |
| parent | 2a2134043ca6ee86d3a3b5fe4bc9d29ffac50612 (diff) | |
Notes
Diffstat (limited to 'usr.bin/netstat/inet.c')
| -rw-r--r-- | usr.bin/netstat/inet.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 4d52eb7b1ec5e..a04cc9a51c33a 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -603,8 +603,13 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) warn("sysctl: net.inet.tcp.stats"); return; } - } else - kread(off, &tcpstat, len); + } else { + u_long tcpstat_p[sizeof(struct tcpstat)/sizeof(uint64_t)]; + + kread(off, &tcpstat_p, sizeof(tcpstat_p)); + kread_counters(tcpstat_p, (uint64_t *)&tcpstat, + sizeof(struct tcpstat)/sizeof(uint64_t)); + } printf ("%s:\n", name); @@ -858,8 +863,13 @@ ip_stats(u_long off, const char *name, int af1 __unused, int proto __unused) warn("sysctl: net.inet.ip.stats"); return; } - } else - kread(off, &ipstat, len); + } else { + u_long ipstat_p[sizeof(struct ipstat)/sizeof(uint64_t)]; + + kread(off, &ipstat_p, sizeof(ipstat_p)); + kread_counters(ipstat_p, (uint64_t *)&ipstat, + sizeof(struct ipstat)/sizeof(uint64_t)); + } printf("%s:\n", name); |
