Skip to contentSkip to conversation

mptcp: TCP_MD5SIG support

PATCH Superseded Geliang Tang 4 participants 14 messages Jul 30, 2025 – Jul 31, 2025 1 message not in the archive

Subsystems (3)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

cover mptcp: TCP_MD5SIG support

From: Geliang Tang <[email protected]>

This series introduces support for TCP_MD5SIG socket options in MPTCP along with code improvements and test cases:

Patch 1: Refactors TCP_MAXSEG getsockopt handling to improve code consistency
Patch 2: Adds setsockopt support for TCP_MD5SIG/TCP_MD5SIG_EXT (first subflow only)
Patch 3: Implements selftests for the new MD5SIG functionality

Geliang Tang (3):
mptcp: Handle TCP_MAXSEG getsockopt in common case
mptcp: setsockopt support for TCP_MD5SIG
selftests: mptcp: add TCP_MD5SIG tests in sockopt

 net/mptcp/sockopt.c                           | 10 +--
 tools/testing/selftests/net/mptcp/config      |  1 +
 .../selftests/net/mptcp/mptcp_sockopt.c       | 67 +++++++++++++++++++
 3 files changed, 74 insertions(+), 4 deletions(-)
Signature · 1 line
2.48.1
author reviewer
#1 lore raw

PATCH 1/3 mptcp: Handle TCP_MAXSEG getsockopt in common case

From: Geliang Tang <[email protected]>

This patch simplifies MPTCP's TCP_MAXSEG getsockopt handling by moving it to the common case where other TCP options are processed. Previously it was handled separately after the main switch statement.

The change:

- Moves TCP_MAXSEG case into the main switch block
- Removes redundant separate handling
- Maintains identical functionality

This improves code consistency without altering behavior.

---
 net/mptcp/sockopt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/mptcp/sockopt.c +1 -3
index 2c267aff95be..b264185b810d 100644
@@ -1404,6 +1404,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_FASTOPEN_CONNECT:
 	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
+	case TCP_MAXSEG:
 		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);
 	case TCP_INQ:
@@ -1428,9 +1429,6 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		return mptcp_put_int_option(msk, optval, optlen, msk->notsent_lowat);
 	case TCP_IS_MPTCP:
 		return mptcp_put_int_option(msk, optval, optlen, 1);
-	case TCP_MAXSEG:
-		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
-						      optval, optlen);
 	}
 	return -EOPNOTSUPP;
 }
Signature · 1 line
2.48.1
author reviewer
#2 lore raw

PATCH 2/3 mptcp: setsockopt support for TCP_MD5SIG

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

---
 net/mptcp/sockopt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/mptcp/sockopt.c +5 -1
index b264185b810d..5b3e54f7d803 100644
@@ -567,10 +567,12 @@ static bool mptcp_supported_sockopt(int level, int optname)
 		case TCP_FASTOPEN_CONNECT:
 		case TCP_FASTOPEN_KEY:
 		case TCP_FASTOPEN_NO_COOKIE:
+		case TCP_MD5SIG:
+		case TCP_MD5SIG_EXT:
 			return true;
 		}
 
-		/* TCP_MD5SIG, TCP_MD5SIG_EXT are not supported, MD5 is not compatible with MPTCP */
+		/* MD5 is not compatible with MPTCP */
 
 		/* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
 		 * TCP_REPAIR_WINDOW are not supported, better avoid this mess
@@ -834,6 +836,8 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_FASTOPEN_CONNECT:
 	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
+	case TCP_MD5SIG:
+	case TCP_MD5SIG_EXT:
 		return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);
 	}
Signature · 1 line
2.48.1
maintainer
#3 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

Hi Geliang,

Quoted 20 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

---
 net/mptcp/sockopt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/mptcp/sockopt.c +0 -0
index b264185b810d..5b3e54f7d803 100644

net/mptcp/sockopt.c static bool mptcp_supported_sockopt(int level, int optname) · line 575

Quoted 10 lines
net/mptcp/sockopt.c +3 -1
@@ -567,10 +567,12 @@ static bool mptcp_supported_sockopt(int level, int optname)
 		case TCP_FASTOPEN_CONNECT:
 		case TCP_FASTOPEN_KEY:
 		case TCP_FASTOPEN_NO_COOKIE:
+		case TCP_MD5SIG:
+		case TCP_MD5SIG_EXT:
 			return true;
 		}
 
-		/* TCP_MD5SIG, TCP_MD5SIG_EXT are not supported, MD5 is not compatible with MPTCP */
+		/* MD5 is not compatible with MPTCP */

Maybe best to update this comment too and move it on top of "case TCP_MD5SIG":

/* MD5 will force a fallback to TCP: OK to set while not connected */

net/mptcp/sockopt.c static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname, · line 842

Quoted 11 lines
net/mptcp/sockopt.c +2 -0
 		/* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
 		 * TCP_REPAIR_WINDOW are not supported, better avoid this mess
@@ -834,6 +836,8 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_FASTOPEN_CONNECT:
 	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
+	case TCP_MD5SIG:
+	case TCP_MD5SIG_EXT:
 		return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);

Just to be sure, can you check if this option will correctly fail if the setsockopt(TCP_MD5SIG*) are used after the establishment of the connection?

I think it is important to set these MD5 options only if the connection is in CLOSED or LISTENED state. I don't think we want to deal with this socket option for ongoing MPTCP connections.

net/mptcp/sockopt.c static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname, · line 843

Quoted 1 line
net/mptcp/sockopt.c +0 -0
 	}

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
#4 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

In reply to Geliang Tang

Hello!

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

Is there even enough option-space to have co-existence of MPTCP with TCP_MD5 ? I don't think so, right ?

The only way they can co-exist is if a bunch of other options are disabled. And in that case, do we really want to use non-MD5 on subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to "improve" security.

So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?

Christoph

Quoted 37 lines
---
 net/mptcp/sockopt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/mptcp/sockopt.c +5 -2
index b264185b810d..5b3e54f7d803 100644
@@ -567,10 +567,12 @@ static bool mptcp_supported_sockopt(int level, int optname)
                case TCP_FASTOPEN_CONNECT:
                case TCP_FASTOPEN_KEY:
                case TCP_FASTOPEN_NO_COOKIE:
+               case TCP_MD5SIG:
+               case TCP_MD5SIG_EXT:
                        return true;
                }
 
-               /* TCP_MD5SIG, TCP_MD5SIG_EXT are not supported, MD5 is not compatible with MPTCP */
+               /* MD5 is not compatible with MPTCP */
 
                /* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
                 * TCP_REPAIR_WINDOW are not supported, better avoid this mess
@@ -834,6 +836,8 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
        case TCP_FASTOPEN_CONNECT:
        case TCP_FASTOPEN_KEY:
        case TCP_FASTOPEN_NO_COOKIE:
+       case TCP_MD5SIG:
+       case TCP_MD5SIG_EXT:
                return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
                                                      optval, optlen);
        }
--

2.48.1

author reviewer
#5 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

Hi Christoph,

Quoted 20 lines · Christoph Paasch

Hello!

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options.
The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Quoted 2 lines

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

Is there even enough option-space to have co-existence of MPTCP with TCP_MD5 ? I don't think so, right ?

Quoted 7 lines

The only way they can co-exist is if a bunch of other options are disabled. And in that case, do we really want to use non-MD5 on subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to "improve" security.

So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?

I just updated this in v2 as you suggested.

Thanks,
-Geliang

Quoted 48 lines

Christoph

Quoted 44 lines

---
 net/mptcp/sockopt.c | 6 +++++-

 1 file changed, 5 insertions(+), 1 deletion(-)
net/mptcp/sockopt.c +0 -0
index b264185b810d..5b3e54f7d803 100644
@@ -567,10 +567,12 @@ static bool mptcp_supported_sockopt(int
 level, int optname)

                case TCP_FASTOPEN_CONNECT:
                case TCP_FASTOPEN_KEY:
                case TCP_FASTOPEN_NO_COOKIE:
+               case TCP_MD5SIG:
+               case TCP_MD5SIG_EXT:
                        return true;
                }

-               /* TCP_MD5SIG, TCP_MD5SIG_EXT are not supported, MD5 is not compatible with MPTCP */
+               /* MD5 is not compatible with MPTCP */

                /* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
                 * TCP_REPAIR_WINDOW are not supported, better avoid this mess

net/mptcp/sockopt.c +0 -0
@@ -834,6 +836,8 @@ static int mptcp_setsockopt_sol_tcp(struct
 mptcp_sock *msk, int optname,

        case TCP_FASTOPEN_CONNECT:
        case TCP_FASTOPEN_KEY:
        case TCP_FASTOPEN_NO_COOKIE:
+       case TCP_MD5SIG:
+       case TCP_MD5SIG_EXT:
                return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
                                                      optval, optlen);
        }
--
2.48.1

maintainer
#6 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

In reply to Christoph Paasch

Hi Christoph,

Quoted 14 lines · Christoph Paasch

Hello!

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

Quoted 7 lines

Is there even enough option-space to have co-existence of MPTCP with TCP_MD5 ? I don't think so, right ?

The only way they can co-exist is if a bunch of other options are disabled. And in that case, do we really want to use non-MD5 on subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to "improve" security.

Correct, there is not enough space, and it doesn't make sense to use MPTCP with TCP_MD5.

The patch description should be clearer about that: supporting TCP_MD5 makes sense when MPTCP is used by default when creating a socket. With Go, all "stream" listening sockets are MPTCP sockets. MPTCP might not be used, but without this series, we have a "regression" compared to TCP because TCP_MD5 cannot be used.

See: https://github.com/multipath-tcp/mptcp_net-next/issues/575

Quoted 1 line

So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?

Yes, but no need to do anything else, because a fallback will be done in mptcp_connect() and subflow_check_req(). (even if I guess an extra protection is always OK there).

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
#7 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

Quoted 35 lines · Matthieu Baerts

Hi Christoph,

Quoted 14 lines · Christoph Paasch

Hello!

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

Quoted 7 lines

Is there even enough option-space to have co-existence of MPTCP with TCP_MD5 ? I don't think so, right ?

The only way they can co-exist is if a bunch of other options are disabled. And in that case, do we really want to use non-MD5 on subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to "improve" security.

Correct, there is not enough space, and it doesn't make sense to use MPTCP with TCP_MD5.

The patch description should be clearer about that: supporting TCP_MD5 makes sense when MPTCP is used by default when creating a socket. With Go, all "stream" listening sockets are MPTCP sockets. MPTCP might not be used, but without this series, we have a "regression" compared to TCP because TCP_MD5 cannot be used.

Quoted 7 lines

See: https://github.com/multipath-tcp/mptcp_net-next/issues/575

Quoted 1 line

So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?

Yes, but no need to do anything else, because a fallback will be done in mptcp_connect() and subflow_check_req(). (even if I guess an extra protection is always OK there).

Alright! Now I see the code in subflow_check_req(). But, it looks like we send a RST, no ? I can give it a try later.

Christoph

Quoted 6 lines

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

maintainer
#8 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

Quoted 38 lines · Christoph Paasch
Quoted 37 lines · Matthieu Baerts

Hi Christoph,

Quoted 14 lines · Christoph Paasch

Hello!

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options. The implementation:
- Allows setting these options (getsockopt remains unsupported)
- Applies them only to the first subflow
- Maintains MD5 compatibility limitations with MPTCP

Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.

Quoted 7 lines

Is there even enough option-space to have co-existence of MPTCP with TCP_MD5 ? I don't think so, right ?

The only way they can co-exist is if a bunch of other options are disabled. And in that case, do we really want to use non-MD5 on subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to "improve" security.

Correct, there is not enough space, and it doesn't make sense to use MPTCP with TCP_MD5.

The patch description should be clearer about that: supporting TCP_MD5 makes sense when MPTCP is used by default when creating a socket. With Go, all "stream" listening sockets are MPTCP sockets. MPTCP might not be used, but without this series, we have a "regression" compared to TCP because TCP_MD5 cannot be used.

See: https://github.com/multipath-tcp/mptcp_net-next/issues/575

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?

Yes, but no need to do anything else, because a fallback will be done in mptcp_connect() and subflow_check_req(). (even if I guess an extra protection is always OK there).

Alright! Now I see the code in subflow_check_req(). But, it looks like we send a RST, no ? I can give it a try later.

Oh, you are right, I missed that.

Then probably we need to force a fallback if
mptcp_setsockopt_first_sf_only() was successful.

(@Geliang: that's why we do need the Packetdrill test :) )

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.

A message that is not in the archive (sent off-list or not yet received): CADg4-L8wqCTT-_n7HibsceThvUCGJ44X2RkRXm=9hiAf4Nn5Wg@mail.gmail.com

maintainer
#10 lore raw

Re: [PATCH mptcp-next 2/3] mptcp: setsockopt support for TCP_MD5SIG

Hi Christoph,

Quoted 70 lines · Christoph Paasch

On Thu, Jul 31, 2025 at 9:08 AM Matthieu Baerts <[email protected] <mailto:[email protected]>> wrote:

On 31/07/2025 18:02, Christoph Paasch wrote:
> On Thu, Jul 31, 2025 at 2:40 AM Matthieu Baerts <[email protected] <mailto:[email protected]>> wrote:
>>
>> Hi Christoph,
>>
>> On 31/07/2025 00:19, Christoph Paasch wrote:
>>> Hello!
>>>
>>> On Wed, Jul 30, 2025 at 12:22 AM Geliang Tang <[email protected] <mailto:[email protected]>> wrote:
>>>>
>>>> From: Geliang Tang <[email protected] <mailto:[email protected]>>
>>>>
>>>> This adds setsockopt support for TCP_MD5SIG and TCP_MD5SIG_EXT options.
>>>> The implementation:
>>>> - Allows setting these options (getsockopt remains unsupported) >>>> - Applies them only to the first subflow
>>>> - Maintains MD5 compatibility limitations with MPTCP >>>>
>>>> Note that TCP_MD5SIG and TCP_MD5SIG_EXT are unsupported for TCP too.
>>>
>>> Is there even enough option-space to have co-existence of MPTCP with >>> TCP_MD5 ? I don't think so, right ?
>>>
>>> The only way they can co-exist is if a bunch of other options are >>> disabled. And in that case, do we really want to use non-MD5 on >>> subsequent subflows ? I doubt that, because the goal of TCP-MD5 is to
>>> "improve" security.
>>
>> Correct, there is not enough space, and it doesn't make sense to use >> MPTCP with TCP_MD5.
>>
>> The patch description should be clearer about that: supporting TCP_MD5
>> makes sense when MPTCP is used by default when creating a socket. With
>> Go, all "stream" listening sockets are MPTCP sockets. MPTCP might not be
>> used, but without this series, we have a "regression" compared to TCP >> because TCP_MD5 cannot be used.
>>
>> See: https://github.com/multipath-tcp/mptcp_net-next/issues/575
<https://github.com/multipath-tcp/mptcp_net-next/issues/575>
>>
>>> So, shouldn't we rather disable MPTCP always when an app sets TCP_MD5SIG ?
>>
>> Yes, but no need to do anything else, because a fallback will be done in
>> mptcp_connect() and subflow_check_req(). (even if I guess an extra >> protection is always OK there).
>
> Alright! Now I see the code in subflow_check_req(). But, it looks like > we send a RST, no ? I can give it a try later.

Oh, you are right, I missed that.

Then probably we need to force a fallback if mptcp_setsockopt_first_sf_only() was successful.

Quoted 6 lines

(@Geliang: that's why we do need the Packetdrill test :) )

Speaking of packetdrill :-) what is the status on upstreaming the MPTCP changes to packetdrill? (Sorry for these questions - I’m catching up on stuff ;-))

:)

The status is still the same as a few years ago: we are still maintaining a public fork [1], and work is still needed to make it "upstreamable". As far as I know, nobody is actively looking at that.

Note that the MPTCP docker dev env image [2] -- used by devs and the CI -- is using this packetdrill version.

[1] https://github.com/multipath-tcp/packetdrill/
[2]
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker#packetdrill

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
author reviewer
#11 lore raw

PATCH 3/3 selftests: mptcp: add TCP_MD5SIG tests in sockopt

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Add test cases for TCP_MD5SIG and TCP_MD5SIG_EXT socket options:
- Enable CONFIG_TCP_MD5SIG in test config
- Implement test functions for both options:
- test_tcp_md5sig_sockopt() - sets basic MD5 key
- test_tcp_md5sig_ext_sockopt() - sets extended MD5 with flags
- Tests run on both IPv4/IPv6 during server setup

---
 tools/testing/selftests/net/mptcp/config      |  1 +
 .../selftests/net/mptcp/mptcp_sockopt.c       | 67 +++++++++++++++++++
 2 files changed, 68 insertions(+)
tools/testing/selftests/net/mptcp/config +1 -0
index 968d440c03fe..d9022261b6f8 100644
@@ -34,3 +34,4 @@ CONFIG_NET_ACT_PEDIT=m
 CONFIG_NET_CLS_ACT=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_SCH_INGRESS=m
+CONFIG_TCP_MD5SIG=y
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +67 -0

91 lines not on this page · raw message

Signature · 1 line
2.48.1
maintainer
#12 lore raw

Re: [PATCH mptcp-next 3/3] selftests: mptcp: add TCP_MD5SIG tests in sockopt

Hi Geliang,

Quoted 8 lines · Geliang Tang

From: Geliang Tang <[email protected]>

Add test cases for TCP_MD5SIG and TCP_MD5SIG_EXT socket options:
- Enable CONFIG_TCP_MD5SIG in test config
- Implement test functions for both options:
- test_tcp_md5sig_sockopt() - sets basic MD5 key
- test_tcp_md5sig_ext_sockopt() - sets extended MD5 with flags
- Tests run on both IPv4/IPv6 during server setup

It looks like you set the socket option, but you don't check if MD5 is correctly used without MPTCP.

It might be better to check this feature with packetdrill:

- set it before/after the listen(), but before an accept(), then check if the server replies without MPTCP, but with MD5.
- if it is set on an establish MPTCP connection (MPTCP still being used), an error should be returned.

Also, you will need to adapt "mptcp_unsupported_sockopts.pkt" test.

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
#13 lore raw
In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Unstable: 2 failed test(s): packetdrill_sockopts selftest_mptcp_connect 🔴
- KVM Validation: debug: Unstable: 2 failed test(s): packetdrill_sockopts selftest_mptcp_connect 🔴
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/16616393711

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/5bf25749282c
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=986936

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer
#14 lore raw
In reply to Geliang Tang

Hi Geliang,

Quoted 10 lines · Geliang Tang

From: Geliang Tang <[email protected]>

This series introduces support for TCP_MD5SIG socket options in MPTCP along with code improvements and test cases:

Patch 1: Refactors TCP_MAXSEG getsockopt handling to improve code consistency
Patch 2: Adds setsockopt support for TCP_MD5SIG/TCP_MD5SIG_EXT (first subflow only)
Patch 3: Implements selftests for the new MD5SIG functionality

Thank you for looking at that!

I have some comments, please see the individual patches.

Quoted 1 line

Can you copy/move this tag to patch 2/3 please?

(Also, I think patch 2 might be seen as a fix, similar to what has been done with TCP_KEEP*, etc.)

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.