HomeFreeBSD

routing: fix RTM_CHANGE nhgroup updates.

Description

routing: fix RTM_CHANGE nhgroup updates.

RTM_CHANGE operates on a single component of the multipath route (e.g. on a single nexthop).
Search of this nexthop is peformed by iterating over each component 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.
Additionally, the followup code modified original necthop group instead of a new one.
Fix this by targetting new nexthop group instead.

Reported by: thj
Tested by: Claudio Jeker <claudio.jeker@klarasystems.com>
Differential Revision: https://reviews.freebsd.org/D35526
MFC after: 2 weeks

(cherry picked from commit c38da70c28a886cc31a2f009baa79deb7fceec88)

Details

Provenance
melifaroAuthored on Jun 25 2022, 6:54 PM
Differential Revision
D35526: routing: fix RTM_CHANGE for multipath #1
Parents
rG3cb0bc54ec48: net/route: Use __diagused for variables only used in KASSERT().
Branches
Unknown
Tags
Unknown