Page MenuHomeFreeBSD

netlink: Fix RTA_MULTIPATH on RTM_GETROUTE
ClosedPublic

Authored by pouria on Mar 31 2026, 4:08 PM.
Tags
None
Referenced Files
F163343584: D56188.diff
Wed, Jul 22, 8:09 AM
F163327882: D56188.id176961.diff
Wed, Jul 22, 3:59 AM
F163287661: D56188.id.diff
Tue, Jul 21, 6:25 PM
F163278556: D56188.id174672.diff
Tue, Jul 21, 4:33 PM
Unknown Object (File)
Mon, Jul 20, 11:44 AM
Unknown Object (File)
Mon, Jul 20, 2:11 AM
Unknown Object (File)
Sat, Jul 18, 10:22 PM
Unknown Object (File)
Wed, Jul 15, 7:15 AM
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 Not Applicable
Unit
Tests Not Applicable

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.Apr 30 2026, 10:08 PM
This revision was automatically updated to reflect the committed changes.