Page MenuHomeFreeBSD

netinet6: factor out cached route lookups from selectroute().
ClosedPublic

Authored by melifaro on Jul 4 2022, 4:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:21 AM
Unknown Object (File)
Tue, Apr 16, 1:53 PM
Unknown Object (File)
Thu, Apr 11, 9:13 AM
Unknown Object (File)
Sat, Apr 6, 5:19 PM
Unknown Object (File)
Mon, Apr 1, 1:07 AM
Unknown Object (File)
Feb 16 2024, 9:51 PM
Unknown Object (File)
Jan 31 2024, 9:19 AM
Unknown Object (File)
Jan 31 2024, 9:19 AM

Details

Summary

Currently selectroute() contains two nearly-identical versions of
the route lookup logic - one for original destination and another
for the case when IPV6_NEXTHOP option was set on the socket.

Factor out handling these route lookups in a separation function to
improve readability.
This change also fixes handling of link-local IPV6_NEXTHOPs.
While here, require all selectroute() consumers to pass both retnh and retifp to simplify return logic.

Test Plan

16:13 [0] m@devel2 s kyua test -k /usr/tests/sys/netinet6/Kyuafile test_ip6_output.py
test_ip6_output.py:TestIP6Output::test_output6_base -> passed [0.392s]
test_ip6_output.py:TestIP6Output::test_output6_nhop -> passed [0.436s]
test_ip6_output.py:TestIP6Output::test_output6_pktinfo[empty] -> passed [0.399s]
test_ip6_output.py:TestIP6Output::test_output6_pktinfo[ifsame] -> passed [0.407s]
test_ip6_output.py:TestIP6Output::test_output6_pktinfo[ipandif] -> passed [0.502s]
test_ip6_output.py:TestIP6Output::test_output6_pktinfo[iponly1] -> passed [0.401s]
test_ip6_output.py:TestIP6Output::test_output6_pktinfo[nolocalip] -> passed [0.416s]
test_ip6_output.py:TestIP6OutputLL::test_output6_linklocal -> passed [0.488s]
test_ip6_output.py:TestIP6OutputMulticast::test_output6_multicast[ff02] -> passed [0.420s]
test_ip6_output.py:TestIP6OutputMulticast::test_output6_multicast[ff05] -> passed [0.422s]
test_ip6_output.py:TestIP6OutputMulticast::test_output6_multicast[ff08] -> passed [0.413s]
test_ip6_output.py:TestIP6OutputMulticast::test_output6_multicast[ff0e] -> passed [0.403s]
test_ip6_output.py:TestIP6OutputNhopLL::test_output6_nhop_linklocal -> passed [0.424s]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

melifaro edited the test plan for this revision. (Show Details)
melifaro added reviewers: network, ae, bz.
This revision was not accepted when it landed; it landed in state Needs Review.Jul 8 2022, 11:21 AM
This revision was automatically updated to reflect the committed changes.