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
F72608285: D35710.diff
Mon, Dec 11, 1:44 AM
Unknown Object (File)
Thu, Nov 30, 2:24 PM
Unknown Object (File)
Tue, Nov 28, 11:55 PM
Unknown Object (File)
Tue, Nov 28, 11:55 PM
Unknown Object (File)
Tue, Nov 28, 11:42 PM
Unknown Object (File)
Nov 8 2023, 2:40 AM
Unknown Object (File)
Nov 7 2023, 2:00 PM
Unknown Object (File)
Nov 7 2023, 2:29 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.