Page MenuHomeFreeBSD

routing: fix RTM_CHANGE for multipath #1
ClosedPublic

Authored by melifaro on Jun 19 2022, 8:28 PM.
Tags
None
Referenced Files
F165181357: D35526.id107170.diff
Thu, Aug 6, 2:31 PM
F165178921: D35526.id107383.diff
Thu, Aug 6, 2:22 PM
Unknown Object (File)
Wed, Aug 5, 6:05 AM
Unknown Object (File)
Sun, Jul 26, 6:41 PM
Unknown Object (File)
Tue, Jul 21, 3:10 AM
Unknown Object (File)
Mon, Jul 20, 3:39 AM
Unknown Object (File)
Mon, Jul 20, 12:27 AM
Unknown Object (File)
Sun, Jul 19, 11:29 PM
Subscribers

Details

Summary

RTM_CHANGE is supposed to operate on a single component of the multipath route (e.g. on a single nexthop). Search of this nexthop is peformed by iterating over each nexthop from multipath (nexthop) group, using check_info_match_nhop. The problem with the current code that it (incorrectly assumes that check_info_match_nhop() returns true value on match, while in reality it returns an error code on failure).
Fix this by properly comparing the result with 0.

Next, the followup code creating a new nexthop group, was modifying original group instead of a new one, leading to the spurious errors.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable