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)
Fri, Sep 13, 8:30 AM
Unknown Object (File)
Wed, Sep 11, 2:00 AM
Unknown Object (File)
Tue, Sep 10, 10:52 PM
Unknown Object (File)
Tue, Sep 10, 7:50 PM
Unknown Object (File)
Tue, Sep 10, 2:20 AM
Unknown Object (File)
Sat, Sep 7, 8:07 AM
Unknown Object (File)
Aug 14 2024, 1:57 AM
Unknown Object (File)
Aug 14 2024, 1:57 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.