From: Antonio Quartulli <antonio@openvpn.net>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, sd@queasysnail.net, ralf@mandelbit.com,
kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com
Subject: Re: [PATCH net-next 4/6] selftests: ovpn: enable TCP_NODELAY on TCP sockets
Date: Tue, 13 Oct 2026 22:17:55 +0200 [thread overview]
Message-ID: <ab62a47a-0690-4cea-bf64-62bdbd1bd21f@openvpn.net> (raw)
In-Reply-To: <179190238850.434549.6180086091448145830@kernel.org>
Hi,
On 13/10/2026 16:39, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] After this patch, no TCP selftest checks the TX peer-ID that
> goes out on the wire.
>
> --
>
> selftests: ovpn: enable TCP_NODELAY on TCP sockets
>
> This commit makes ovpn-cli set TCP_NODELAY on its TCP sockets by default.
> Setting OVPN_TCP_NODELAY=0 turns it off, and the new test-tcp-nagle.sh
> uses that to keep running the TCP suite with Nagle enabled. It also limits
> the tcpdump-based peer ID check in ovpn_run_basic_traffic() to UDP.
>
>> diff --git a/tools/testing/selftests/net/ovpn/test.sh b/tools/testing/selftests/net/ovpn/test.sh
>> index 392109d5e14e2..e2e6ffdd29bb0 100755
>> --- a/tools/testing/selftests/net/ovpn/test.sh
>> +++ b/tools/testing/selftests/net/ovpn/test.sh
>> @@ -137,35 +137,33 @@ ovpn_run_basic_traffic() {
>> local tcpdump_timeout="1.5s"
>>
>> for p in $(seq 1 ${OVPN_NUM_PEERS}); do
>
> [ ... ]
>
>> if [ "${OVPN_PROTO}" == "UDP" ]; then
>
> [ ... ]
>
>> @@ -173,8 +171,10 @@ ovpn_run_basic_traffic() {
>> ip netns exec ovpn_peer0 \
>> ping -qfc 100 -s 3000 -w 3 5.5.5.$((p + 1))
>>
>> - wait "${tcpdump_pid1}" || return 1
>> - wait "${tcpdump_pid2}" || return 1
>> + if [ "${OVPN_PROTO}" == "UDP" ]; then
>> + wait "${tcpdump_pid1}" || return 1
>> + wait "${tcpdump_pid2}" || return 1
>> + fi
>> done
>> }
>
> [Severity: Medium]
> This patch removes the TCP branch of ovpn_build_capture_filter() and makes
> these waits UDP-only. After that, does any TCP selftest still check the
> peer-id that goes out on the wire?
>
> The capture was added by commit 367f4b163a8c ("selftests: ovpn: check
> asymmetric peer-id"). Its purpose was to check the peer-id in the data
> packet headers for every connection, TCP included.
>
> On the kernel side, the TCP receive path never reads the peer-id from the
> packet. It takes the peer that is bound to the socket:
>
> drivers/net/ovpn/tcp.c:ovpn_tcp_rcv() {
> ...
> ovpn_recv(peer, skb);
> ...
> }
>
> So if a TCP peer had the wrong tx_id here, traffic would still flow:
>
> drivers/net/ovpn/crypto_aead.c:ovpn_aead_encrypt() {
> ...
> op = ovpn_opcode_compose(OVPN_DATA_V2, ks->key_id, peer->tx_id);
> ...
> }
>
> The JSON expectations in the selftest directory don't compare tx-id
> either. With this change, test-tcp.sh, test-symmetric-id-tcp.sh and the new
> test-tcp-nagle.sh would all pass with an incorrect TCP tx_id.
>
> The later patch in the series ("selftests: ovpn: wait for the TCP server
> key setup before traffic") does not bring the TCP check back.
>
> Could these TCP variants keep some form of peer-id check that does not
> depend on TCP segment boundaries?
>
Testing tx-peer-id with TCP_NODELAY enabled is extremely challenging
because we'd need to (almost) re-implement an OpenVPN TCP stream parser
in the selftest.
Since the rest of the selftests already ensures that packets are well
formed and that the ovpn TCP state machine works as expected, we decided
to simply give up on this specific on-wire test.
We don't think to be losing coverage by doing so.
Hence this decision was deliberate.
Regards,
--
Antonio Quartulli
OpenVPN Inc.
next prev parent reply other threads:[~2026-10-13 20:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 13:37 [PATCH net-next 0/6] pull request: ovpn 2026-10-12 Antonio Quartulli
2026-10-12 13:37 ` [PATCH net-next 1/6] ovpn: Fix the return value in ovpn_bind_from_sockaddr() kernel-doc Antonio Quartulli
2026-10-12 13:37 ` [PATCH net-next 2/6] ovpn: remove unused work field from struct ovpn_socket Antonio Quartulli
2026-10-12 13:38 ` [PATCH net-next 3/6] ovpn: remove redundant peer NULL checks in crypto post functions Antonio Quartulli
2026-10-12 13:38 ` [PATCH net-next 4/6] selftests: ovpn: enable TCP_NODELAY on TCP sockets Antonio Quartulli
2026-10-13 14:39 ` netdev-bot+sashiko
2026-10-13 20:17 ` Antonio Quartulli [this message]
2026-10-12 13:38 ` [PATCH net-next 5/6] selftests: ovpn: wait for the TCP server key setup before traffic Antonio Quartulli
2026-10-13 14:39 ` netdev-bot+sashiko
2026-10-12 13:38 ` [PATCH net-next 6/6] MAINTAINERS: ovpn: add Ralf Lici as reviewer Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab62a47a-0690-4cea-bf64-62bdbd1bd21f@openvpn.net \
--to=antonio@openvpn.net \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ralf@mandelbit.com \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox