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

Details

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