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:
parent
cf76495e0a
commit
4084b1ab04
@ -39,7 +39,6 @@ all _rip6stat
|
|||||||
all _ripcbinfo
|
all _ripcbinfo
|
||||||
all _rtree
|
all _rtree
|
||||||
all _rtstat
|
all _rtstat
|
||||||
all _rttrash
|
|
||||||
all _sctpstat
|
all _sctpstat
|
||||||
all _sfstat
|
all _sfstat
|
||||||
all _tcbinfo
|
all _tcbinfo
|
||||||
|
@ -699,19 +699,13 @@ void
|
|||||||
rt_stats(void)
|
rt_stats(void)
|
||||||
{
|
{
|
||||||
struct rtstat rtstat;
|
struct rtstat rtstat;
|
||||||
u_long rtsaddr, rttaddr;
|
u_long rtsaddr;
|
||||||
int rttrash;
|
|
||||||
|
|
||||||
if ((rtsaddr = nl[N_RTSTAT].n_value) == 0) {
|
if ((rtsaddr = nl[N_RTSTAT].n_value) == 0) {
|
||||||
xo_emit("{W:rtstat: symbol not in namelist}\n");
|
xo_emit("{W:rtstat: symbol not in namelist}\n");
|
||||||
return;
|
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_counters(rtsaddr, (char *)&rtstat, sizeof (rtstat));
|
||||||
kread(rttaddr, (char *)&rttrash, sizeof (rttrash));
|
|
||||||
xo_emit("{T:routing}:\n");
|
xo_emit("{T:routing}:\n");
|
||||||
|
|
||||||
#define p(f, m) if (rtstat.f || sflag <= 1) \
|
#define p(f, m) if (rtstat.f || sflag <= 1) \
|
||||||
@ -728,9 +722,4 @@ rt_stats(void)
|
|||||||
p(rts_wildcard, "\t{:wildcard-uses/%ju} "
|
p(rts_wildcard, "\t{:wildcard-uses/%ju} "
|
||||||
"{N:/use%s of a wildcard route}\n");
|
"{N:/use%s of a wildcard route}\n");
|
||||||
#undef p
|
#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));
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user