All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Hangbin Liu <hangbin.liu@linux.dev>, MPTCP Linux <mptcp@lists.linux.dev>
Cc: Florian Westphal <fw@strlen.de>, Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH mptcp-next] selftests: mptcp: use offset to match RM_ADDR message
Date: Thu, 8 Oct 2026 13:46:12 +0200	[thread overview]
Message-ID: <b7438cbf-0674-4b8f-aa23-3ba5791cfe26@kernel.org> (raw)
In-Reply-To: <20261008-mptcp_rm_addr-v1-1-b4d35ac8afef@kylinos.cn>

Hi Hangbin,

Thank you for the follow-up!

On 08/10/2026 12:06, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> nft cannot match RM_ADDR when it is the second MPTCP option,

Do you mind adding a short explanation why or just a ref to:

 https://lore.kernel.org/a391d81c-0bce-41e6-886e-a558765c6891@kernel.org

Also, could you title this patch:

  Squash to "selftests: mptcp: convert iptables to nftables for
  mptcp_join.sh"

And mention what should be added to the original commit message, please?

> so we rely on hard-coded offsets. A tcpdump capture of the RM_ADDR
> message looks like:
> 
>   [TCP header: 20 bytes] [nop] [nop] [timestamp: 10 bytes] \
>         [MPTCP DSS: 12 bytes] [MPTCP RM_ADDR: 4 bytes]
> 
> We verify: TCP Data Offset (TCP[12] × 8) equals 48 bytes (12 x 4),
> DSS length (TCP[33] x 8) is 12 bytes, and RM_ADDR subtype (TCP[46] × 8)
> is 4. This matches the old cBPF check, which calculated offsets starting
> from the IP header:
> 
> (ip[32] & 0xf0) == 0xc0 && ip[53] == 0x0c && (ip[66] & 0xf0) == 0x40
> 
> Also add MPTCP kind (30) checks for the DSS (TCP[32] x 8) and RM_ADDR
> (TCP[44] x 8) options.

Good idea.

> 
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
> ---
>  tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index b16e24418e73..194b80277ae2 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -4375,7 +4375,12 @@ endpoint_tests()
>  		local nft=1
>  		ip netns exec "${ns2}" nft insert rule ip filter OUTPUT \
>  			ip saddr 10.0.1.2 meta l4proto tcp \
> -			tcp option mptcp subtype remove-addr drop || nft=0
> +			@th,96,4 == 12 \
> +			@th,256,8 == 30 \
> +			@th,264,8 == 12 \
> +			@th,352,8 == 30 \
> +			@th,368,4 == 4 \
> +			drop || nft=0
>  		local i
>  		for i in $(seq 3); do
>  			pm_nl_del_endpoint $ns2 1 10.0.1.2
> @@ -4454,7 +4459,12 @@ endpoint_tests()
>  		local nft=1
>  		ip netns exec "${ns1}" nft insert rule ip filter OUTPUT \
>  			ip saddr 10.0.1.1 meta l4proto tcp \
> -			tcp option mptcp subtype remove-addr drop || nft=0
> +			@th,96,4 == 12 \
> +			@th,256,8 == 30 \
> +			@th,264,8 == 12 \
> +			@th,352,8 == 30 \
> +			@th,368,4 == 4 \

Do you mind just adding this sequence to a global variable (an array?),
similar to what was done before with the cBPF filter, with a short
comment, please?

That would be easier to understand here, and to avoid duplicated code.

> +			drop || nft=0
>  		pm_nl_del_endpoint $ns1 42 10.0.1.1
>  		sleep 0.5
>  		chk_subflow_nr "after delete ID 0" 2
> 
> ---
> base-commit: 9651c766735c19e7a6b90d731bab53ef7959def8
> change-id: 20261008-mptcp_rm_addr-92ab7ff3d94d
> 
> Best regards,

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  parent reply	other threads:[~2026-10-08 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 10:06 [PATCH mptcp-next] selftests: mptcp: use offset to match RM_ADDR message Hangbin Liu
2026-10-08 11:21 ` MPTCP CI
2026-10-08 11:46 ` Matthieu Baerts [this message]
2026-10-08 13:40   ` hangbin.liu
2026-10-08 13:43     ` Matthieu Baerts

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=b7438cbf-0674-4b8f-aa23-3ba5791cfe26@kernel.org \
    --to=matttbe@kernel.org \
    --cc=fw@strlen.de \
    --cc=hangbin.liu@linux.dev \
    --cc=liuhangbin@kylinos.cn \
    --cc=mptcp@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.