[PATCH net v2 0/2] psp: fix transport mode with ipv6 extension headers

From: Todd Freed

Date: Thu Oct 22 2026 - 18:31:22 EST


While working on adding support for socket-less psp associations, I
noticed that this case was not being handled correctly. It will be more
relevant with that series, because it adds udp support, for which the
psp nexthdr will be taken from the inner packet.

Since the tx association encodes intent to send encrypted packets, but
because of other configuration (socket options, routes) the packets are
sent unencrypted, sending this change as a fix.

The first patch adds the requisite code to walk the ipv6 extension
headers chain, and stamp the last one to UDP instead of the fixed hdr.
The second patch adds selftests for this case.

Note that no test case is added for ipv6 fragment headers. As far as
I can tell it's not possible to tx fragments from an ipv6 tcp socket.

v2:
- walk the extension headers instead of dropping (Daniel)
- reject fragment headers (Bjorn, Daniel)
- reject routing headers
- psp_dev_rcv() handle the rx case as well

v1:
- https://lore.kernel.org/netdev/20261021210200.788191-1-toddfreed@xxxxxxxx

Todd Freed (2):
psp: fix transport mode encap with ipv6 extension headers
selftests: drv-net: psp: test ipv6 tcp socket with extension headers

net/psp/psp_main.c | 78 ++++++++++--
tools/testing/selftests/drivers/net/config | 1 +
tools/testing/selftests/drivers/net/psp.py | 138 ++++++++++++++++++++-
3 files changed, 207 insertions(+), 10 deletions(-)

--
2.53.0-Meta