freebsd-skq/usr.bin/netstat
Mike Karels 7483fbadf4 Fix netstat -gs with ip_mroute module and/or vnet
The code for "netstat -gs -f inet" failed if the kernel namelist did not
include the _mrtstat symbol. However, that symbol is not in a standard
kernel even with the ip_mroute module loaded, where the functionality is
available. It is also not in a kernel with MROUTING but also VIMAGE, as
there can be multiple sets of stats. However, when running the command
on a live system, the symbol is not used; a sysctl is used. Go ahead
and try the sysctl in any case, and complain that IPv4 MROUTING is not
present only if the sysctl fails with ENOENT. Also fail if _mrtstat is
not defined when running on a core file; netstat doesn't know about vnets,
so can only work if MROUTING was included, and VIMAGE was not.

Reviewed by:	bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D22311
2019-11-12 01:03:08 +00:00
..
bpf.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
if.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
inet6.c IPv6 cleanup: netstat 2019-08-01 20:36:25 +00:00
inet.c Restore description of packets dropped due to full reassembly queue. 2019-10-03 18:24:41 +00:00
ipsec.c Tidy up the list of auth and encryption algorithms for IPsec stats. 2019-08-07 00:53:27 +00:00
main.c Add the "TCP Blackbox Recorder" which we discussed at the developer 2018-03-22 09:40:08 +00:00
Makefile After inpcb route caching was put back in place there is no need for 2017-07-27 13:03:36 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mbuf.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
mroute6.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
mroute.c Fix netstat -gs with ip_mroute module and/or vnet 2019-11-12 01:03:08 +00:00
netgraph.c Hide struct socket and struct unpcb from the userland. 2017-10-02 23:29:56 +00:00
netisr.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
netstat.1 Bump netstat.1's .Dd after r331347. 2018-03-22 09:43:15 +00:00
netstat.h Add the "TCP Blackbox Recorder" which we discussed at the developer 2018-03-22 09:40:08 +00:00
nlist_symbols
pfkey.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
route.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
sctp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
unix.c Use uintptr_t alone when assigning to kvaddr_t variables. 2018-07-10 13:03:06 +00:00