NetBSD/usr.bin/netstat
ozaki-r 1d675d5a3a netstat: strengthen against kernel changes
netstat uses sysctlbyname to get counter data from the kernel.
sysctlbyname fails with ENOMEM if actual counter data in the kernel is
larger than a passed buffer.  netstat just skips showing counters of a
category if sysctlbyname fails, so if we added new counters of the
category to the kernel, nestat shows nothing for the category.

Fortunately sysctlbyname fills data as much as possible even if a passed
buffer is short.  So we can allow netstat to show the filled data anyway
if sysctlbyname fails with ENOMEM.

Note that this backcompat mechanism works only if new counters are
appended, and doesn't work if new counters are inserted into the middle
or counters are moved.
2020-08-28 07:23:48 +00:00
..
Makefile
atalk.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
bpf.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
fast_ipsec.c
if.c
inet.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
inet6.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
main.c
mbuf.c
mroute.c
mroute6.c
netstat.1
netstat.h
netstat_hostops.c
netstat_rumpops.c
pfkey.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
pfsync.c netstat: strengthen against kernel changes 2020-08-28 07:23:48 +00:00
route.c
unix.c
vtw.c
vtw.h