diff options
| author | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-02-22 18:41:31 +0000 |
|---|---|---|
| committer | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-03-26 09:12:14 +0000 |
| commit | f088a26db73c269e2aa11caed33294ae1ece3814 (patch) | |
| tree | 065a92bf13a9fc33bba9762c208d2b1580f72038 | |
| parent | 824f5e72176d17fdfc14be0f2c6f752d7972471c (diff) | |
| -rw-r--r-- | sbin/route/route_netlink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c index ba22a2ec1e22..5dde7501d6b4 100644 --- a/sbin/route/route_netlink.c +++ b/sbin/route/route_netlink.c @@ -263,6 +263,9 @@ rtmsg_nl_int(struct nl_helper *h, int cmd, int rtm_flags, int fib, int rtm_addrs snl_end_attr_nested(&nw, off); } + if (rt_metrics->rmx_expire > 0) + snl_add_msg_attr_u32(&nw, NL_RTA_EXPIRES, rt_metrics->rmx_expire); + if (rt_metrics->rmx_weight > 0) snl_add_msg_attr_u32(&nw, NL_RTA_WEIGHT, rt_metrics->rmx_weight); @@ -343,7 +346,6 @@ static void print_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *dst) { struct snl_state *ss = &h->ss_cmd; - struct timespec ts; struct snl_parsed_route r = { .rtax_weight = RT_DEFAULT_WEIGHT }; if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) @@ -385,11 +387,7 @@ print_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *dst) printf("%8lu ", 0UL); printf("%8lu ", rmx.rmx_mtu); printf("%8lu ", rmx.rmx_weight); - if (rmx.rmx_expire > 0) - clock_gettime(CLOCK_REALTIME_FAST, &ts); - else - ts.tv_sec = 0; - printf("%8ld \n", (long)(rmx.rmx_expire - ts.tv_sec)); + printf("%8ld \n", rmx.rmx_expire); } static void |
