Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/usr.bin/netstat
Module Name: src
Committed By: ozaki-r
Date: Fri Aug 28 07:23:48 UTC 2020
Modified Files:
src/usr.bin/netstat: atalk.c bpf.c inet.c inet6.c pfkey.c pfsync.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/netstat/pfkey.c \
src/usr.bin/netstat/pfsync.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index