--- - branch: MAIN date: Fri Aug 28 07:23:48 UTC 2020 files: - new: '1.19' old: '1.18' path: src/usr.bin/netstat/atalk.c pathrev: src/usr.bin/netstat/atalk.c@1.19 type: modified - new: '1.15' old: '1.14' path: src/usr.bin/netstat/bpf.c pathrev: src/usr.bin/netstat/bpf.c@1.15 type: modified - new: '1.113' old: '1.112' path: src/usr.bin/netstat/inet.c pathrev: src/usr.bin/netstat/inet.c@1.113 type: modified - new: '1.77' old: '1.76' path: src/usr.bin/netstat/inet6.c pathrev: src/usr.bin/netstat/inet6.c@1.77 type: modified - new: '1.3' old: '1.2' path: src/usr.bin/netstat/pfkey.c pathrev: src/usr.bin/netstat/pfkey.c@1.3 type: modified - new: '1.3' old: '1.2' path: src/usr.bin/netstat/pfsync.c pathrev: src/usr.bin/netstat/pfsync.c@1.3 type: modified id: 20200828T072348Z.2dae1221002c8b059e4cb93f5571c822efaa724e log: | 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. module: src subject: 'CVS commit: src/usr.bin/netstat' unixtime: '1598599428' user: ozaki-r