]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netinet6: simplify selectroute()
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Mon, 4 Jul 2022 18:05:38 +0000 (18:05 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Fri, 8 Jul 2022 11:27:16 +0000 (11:27 +0000)
commit2756774c3f537bc566362ef424d992092fb6fc87
treee297cb87c146a77e439bbcbb7e2e167a712d7a82
parent81a235ecde893a666e3cfac503068d9ea1bb013c
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
sys/netinet6/in6_src.c