HomeFreeBSD

netinet6: simplify selectroute()

Description

netinet6: simplify selectroute()

Effectively selectroute() addresses two different cases:
providing interface info for multicast destinations and providing
nexthop data for unicast ones. Current implementation intertwines
handling of both cases, especially in the error handling part.
Factor out all route lookup logic in a separate function,
lookup_route() to simplify the code.
Ensure consistent KPI: no error means *retifp is set and otherwise.

Differential Revision: https://reviews.freebsd.org/D35711
MFC after: 2 weeks

(cherry picked from commit 2756774c3f537bc566362ef424d992092fb6fc87)

Details

Provenance
melifaroAuthored on Jul 4 2022, 6:05 PM
Differential Revision
D35711: netinet6: simplify selectroute()
Parents
rG6554c7743bb1: netinet6: factor out cached route lookups from selectroute().
Branches
Unknown
Tags
Unknown