Fix netstat -rs reporting.

rttrash (unused but not yet delete entries) were eliminated
 during routing rework. Remove reading these symbols from the kernel.

PR:		254681
Reported by:	rashey@superbox.pl
MFC after:	immediately
This commit is contained in:
Alexander V. Chernikov 2021-03-31 20:56:26 +00:00
parent cf76495e0a
commit 4084b1ab04
2 changed files with 1 additions and 13 deletions

View File

@ -39,7 +39,6 @@ all _rip6stat
all _ripcbinfo
all _rtree
all _rtstat
all _rttrash
all _sctpstat
all _sfstat
all _tcbinfo

View File

@ -699,19 +699,13 @@ void
rt_stats(void)
{
struct rtstat rtstat;
u_long rtsaddr, rttaddr;
int rttrash;
u_long rtsaddr;
if ((rtsaddr = nl[N_RTSTAT].n_value) == 0) {
xo_emit("{W:rtstat: symbol not in namelist}\n");
return;
}
if ((rttaddr = nl[N_RTTRASH].n_value) == 0) {
xo_emit("{W:rttrash: symbol not in namelist}\n");
return;
}
kread_counters(rtsaddr, (char *)&rtstat, sizeof (rtstat));
kread(rttaddr, (char *)&rttrash, sizeof (rttrash));
xo_emit("{T:routing}:\n");
#define p(f, m) if (rtstat.f || sflag <= 1) \
@ -728,9 +722,4 @@ rt_stats(void)
p(rts_wildcard, "\t{:wildcard-uses/%ju} "
"{N:/use%s of a wildcard route}\n");
#undef p
if (rttrash || sflag <= 1)
xo_emit("\t{:unused-but-not-freed/%u} "
"{N:/route%s not in table but not freed}\n",
rttrash, plural(rttrash));
}