git: 6dd429aeabec - main - route(8): Show metric value in get route
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 May 2026 20:58:50 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=6dd429aeabecd63ece3c567b73472e2c75991afc
commit 6dd429aeabecd63ece3c567b73472e2c75991afc
Author: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-05-03 11:55:25 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-05-20 20:55:05 +0000
route(8): Show metric value in get route
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56325
---
sbin/route/route_netlink.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
index 531336903896..eef8c2cfef18 100644
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -383,16 +383,18 @@ print_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *dst)
struct rt_metrics rmx = {
.rmx_mtu = r.rtax_mtu,
.rmx_weight = r.rtax_weight,
+ .rmx_metric = r.rta_metric,
.rmx_expire = r.rta_expire,
};
- printf("\n%9s %9s %9s %9s %9s %10s %9s\n", "recvpipe",
- "sendpipe", "ssthresh", "rtt,msec", "mtu ", "weight", "expire");
+ printf("\n%9s %9s %9s %9s %9s %9s %9s %9s\n", "recvpipe", "sendpipe",
+ "ssthresh", "rtt,msec", "mtu ", "metric", "weight", "expire");
printf("%8lu ", rmx.rmx_recvpipe);
printf("%8lu ", rmx.rmx_sendpipe);
printf("%8lu ", rmx.rmx_ssthresh);
printf("%8lu ", 0UL);
printf("%8lu ", rmx.rmx_mtu);
+ printf("%8lu ", rmx.rmx_metric);
printf("%8lu ", rmx.rmx_weight);
printf("%8ld \n", rmx.rmx_expire);
}
@@ -436,6 +438,7 @@ print_nhop_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *ds
.gw = r.rta_gw,
.ifindex = r.rta_oif,
.rtax_mtu = link.ifla_mtu,
+ .rta_metric = r.rta_metric,
};
printf("\tvia ");
print_nlmsg_route_nhop(h, &r, &nh, true);