aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/lib/py/utils.py
diff options
context:
space:
mode:
authorGuillaume Nault <[email protected]>2024-12-16 17:21:44 +0000
committerJakub Kicinski <[email protected]>2024-12-20 21:50:09 +0000
commit1dbdce30f040a87f5aa6a9dbe43be398737f090f (patch)
treec171045b99d5d3940b8635e974a32f25867511a2 /tools/testing/selftests/net/lib/py/utils.py
parentnet: dsa: microchip: Do not execute PTP driver code for unsupported switches (diff)
downloadkernel-1dbdce30f040a87f5aa6a9dbe43be398737f090f.tar.gz
kernel-1dbdce30f040a87f5aa6a9dbe43be398737f090f.zip
ipv4: Define inet_sk_init_flowi4() and use it in inet_sk_rebuild_header().
IPv4 code commonly has to initialise a flowi4 structure from an IPv4 socket. This requires looking at potential IPv4 options to set the proper destination address, call flowi4_init_output() with the correct set of parameters and run the sk_classify_flow security hook. Instead of reimplementing these operations in different parts of the stack, let's define inet_sk_init_flowi4() which does all these operations. The first user is inet_sk_rebuild_header(), where inet_sk_init_flowi4() replaces ip_route_output_ports(). Unlike ip_route_output_ports(), which sets the flowi4 structure and performs the route lookup in one go, inet_sk_init_flowi4() only initialises the flow. The route lookup is then done by ip_route_output_flow(). Decoupling flow initialisation from route lookup makes this new interface applicable more broadly as it will allow some users to overwrite specific struct flowi4 members before the route lookup. Signed-off-by: Guillaume Nault <[email protected]> Link: https://patch.msgid.link/fd416275262b1f518d5abfcef740ce4f4a1a6522.1734357769.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
0 files changed, 0 insertions, 0 deletions