aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-02-22 16:35:23 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-02-26 09:48:09 +0000
commit2f7cfeebcc4356d3bb85e953900ba5d3f75831ff (patch)
tree586401f4b7410149e9dc0acb271f27260ed2a90f
parentff6d1faa65a1a77d04746b43023feb457cfa27b8 (diff)
netstat(1): Fix expire column in -r flag using netlink
Reviewed by: glebius MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D55440
-rw-r--r--usr.bin/netstat/route_netlink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/netstat/route_netlink.c b/usr.bin/netstat/route_netlink.c
index e7b2a1964602..2c4b7a5c6b00 100644
--- a/usr.bin/netstat/route_netlink.c
+++ b/usr.bin/netstat/route_netlink.c
@@ -218,8 +218,8 @@ p_path(struct snl_parsed_route *rt, bool is_mpath)
else
xo_emit("{t:interface-name/%*.*s}", wid.iface, wid.iface,
prettyname);
- if (rt->rta_expires > 0) {
- xo_emit(" {:expire-time/%*u}", wid.expire, rt->rta_expires);
+ if (rt->rta_expire > 0) {
+ xo_emit(" {:expire-time/%*u}", wid.expire, rt->rta_expire);
}
}
@@ -244,6 +244,7 @@ p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr)
rt.rtax_weight = nhop->rtnh_weight;
rt.rta_rtflags = nhop->rta_rtflags ? nhop->rta_rtflags : orig_rtflags;
rt.rtax_mtu = nhop->rtax_mtu ? nhop->rtax_mtu : orig_mtu;
+ rt.rta_expire = nhop->rta_expire;
xo_open_instance(name);
p_path(&rt, true);