Page MenuHomeFreeBSD

netlink: Fix RTA_MULTIPATH on RTM_GETROUTE
ClosedPublic

Authored by pouria on Mar 31 2026, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 15, 2:25 PM
Unknown Object (File)
Fri, May 15, 12:52 PM
Unknown Object (File)
Thu, May 14, 6:19 PM
Unknown Object (File)
Thu, May 14, 4:28 PM
Unknown Object (File)
Tue, May 12, 9:27 AM
Unknown Object (File)
Fri, May 8, 3:13 AM
Unknown Object (File)
Mon, Apr 27, 2:47 PM
Unknown Object (File)
Sat, Apr 25, 3:29 PM
Subscribers

Details

Summary

Before this patch, netlink never returned RTA_MULTIPATH.
Also, add RTA_MULTIPATH attribute in way that don't confuse
non-mpath support consumers.

Diff Detail

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

Event Timeline

sys/netlink/route/rt.c
189

For reviewers, Without this, non-mpath aware apps can't find their gw, therefore, we choose one here for netlink users. see line 658 below.

349–353

For reviewers, without these changes here + removal of nhop_select_func() from line 658 it was impossible to return RTA_MULTIPATH.
Since we overwrite nhgrp of rnd by nhop_select_func() to nhop. So this patch will restore the intended behavior.

This comment was removed by pouria.

Also return the weight of selected nhop from nhgrp.

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Apr 30, 10:08 PM
This revision was automatically updated to reflect the committed changes.