Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Apr 2021 08:44:28 GMT
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1260724822b5 - stable/13 - Fix `netstat -rs` reporting.
Message-ID:  <202104040844.1348iSQB058929@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=1260724822b5830411cbf56d48e997be1628e53b

commit 1260724822b5830411cbf56d48e997be1628e53b
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-03-31 20:56:26 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-04-04 08:44:01 +0000

    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
    
    (cherry picked from commit 4084b1ab0413d15dab496b1c24c3875601c71438)
---
 usr.bin/netstat/nlist_symbols |  1 -
 usr.bin/netstat/route.c       | 13 +------------
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/usr.bin/netstat/nlist_symbols b/usr.bin/netstat/nlist_symbols
index afad45d353bd..1c09d81c0b98 100644
--- a/usr.bin/netstat/nlist_symbols
+++ b/usr.bin/netstat/nlist_symbols
@@ -39,7 +39,6 @@ all	_rip6stat
 all	_ripcbinfo
 all	_rtree
 all	_rtstat
-all	_rttrash
 all	_sctpstat
 all	_sfstat
 all	_tcbinfo
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index ba47a4b56ac5..317e3ffb9607 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104040844.1348iSQB058929>