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

Details

Provenance
melifaroAuthored on Jun 25 2022, 6:54 PM
Differential Revision
D35526: routing: fix RTM_CHANGE for multipath #1
Parents
rG2c28cd09d9f7: cuse(3): Remove PAGE_SIZE from libcuse.
Branches
Unknown
Tags
Unknown