Page MenuHomeFreeBSD

route(8): print nexthop weight in monitor
AbandonedPublic

Authored by pouria on Feb 25 2026, 11:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 10, 3:29 AM
Unknown Object (File)
Sun, Aug 9, 5:52 PM
Unknown Object (File)
Tue, Aug 4, 2:50 AM
Unknown Object (File)
Fri, Jul 31, 2:14 AM
Unknown Object (File)
Mon, Jul 27, 10:18 AM
Unknown Object (File)
Tue, Jul 21, 5:08 PM
Unknown Object (File)
Jul 11 2026, 3:28 PM
Unknown Object (File)
Jul 10 2026, 3:16 PM
Subscribers

Details

Reviewers
None
Group Reviewers
network
Summary

Not showing the weight of nexthops in route monitor
is pointless.

I was testing the -weight option in routing subsystem and found out
there is no utility that shows the nexthops of specific route.
After reading the route(8) source code, I found out that route monitor
shows every nexthop of a specific route that is changing.
However, couldn't find their nexthop weight.

This change is also useful for reusing the print_nlmsg_route_nhop for future
implementations.

Test Plan

simply run route monitor and then
add a route with two different gateways.
Result:

# route -n6 monitor
14:33:02.019 PID 1686 add/repl route 3fff::1/128 gw ::1 iface lo0 mtu 16384 weight 1 table inet6.0
						 gw 2001:db8::1 iface vtnet0 mtu 1500 weight 2

Routes with a single nexthop shows weight 0, which is expected for now.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70989
Build 67872: arc lint + arc unit