From c8f34118ac8207660385f99b78e8daa03ec2408f Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Mon, 20 Jun 2022 08:59:15 +0000 Subject: [PATCH] netstat: print path weight when showing routes in structured output. Differential Revision: https://reviews.freebsd.org/D35530 MFC after: 2 weeks --- usr.bin/netstat/route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 317e3ffb9607..c2a68cae87e8 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -329,6 +329,8 @@ p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm) snprintf(buffer, sizeof(buffer), "{[:-%d}{:flags/%%s}{]:} ", wid_flags - protrusion); p_flags(rtm->rtm_flags, buffer); + /* Output path weight as non-visual property */ + xo_emit("{e:weight/%u}", rtm->rtm_rmx.rmx_weight); if (Wflag) { /* XXX: use=0? */ xo_emit("{t:nhop/%*lu} ", wid_mtu, rtm->rtm_rmx.rmx_nhidx);