netstat: print path weight when showing routes in structured output.

Differential Revision: https://reviews.freebsd.org/D35530
MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2022-06-20 08:59:15 +00:00
parent 8db679af66
commit c8f34118ac

View File

@ -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);