Skip to content

Force MP_FASTCLOSE on MPTCP teardown (#54 follow-up) - #67

Merged
lance0 merged 3 commits into
masterfrom
mptcp-close-investigation
Apr 21, 2026
Merged

lance0 merged 3 commits into
masterfrom
mptcp-close-investigation

Conversation

@lance0

@lance0 lance0 commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the MPTCP half of #54. Previous fixes (PR #55, PR #59) addressed the stuck-write loop and SO_LINGER=0 behavior for plain TCP, but MPTCP teardown stayed graceful even with SO_LINGER set: __mptcp_close() only routes through mptcp_do_fastclose() when the receive queue has unread data or the linger timeout is negative, neither of which is true for a normal upload-only test that hits its deadline.

Root cause (kernel-side)

SO_LINGER=0 propagates to MPTCP subflows (kernel patch from April 2021), but the msk-level close path doesn't act on it directly. The supported userland mechanism for forcing MP_FASTCLOSE is connect(fd, AF_UNSPEC) → mptcp_disconnect() → MPTCP_CF_FASTCLOSE → MP_FASTCLOSE on each subflow. There is no documented MPTCP_FASTCLOSE setsockopt; connect(AF_UNSPEC) is it.

@matttbe (the upstream MPTCP maintainer) traced this empirically on Linux 6.17:

  • MPTCP + SO_LINGER=0 + close(): peer sees graceful EOF
  • MPTCP + connect(AF_UNSPEC) + close(): peer sees ECONNRESET

What this PR does

Adds three Linux-only helpers in src/tcp.rs:

  • is_mptcp_socket(fd) — getsockopt(IPPROTO_TCP, TCP_IS_MPTCP). Returns false on plain TCP or older kernels without the option, so the fastclose path stays a no-op.
  • mptcp_force_fastclose(fd, stream_id) — connect(fd, AF_UNSPEC), with debug logging on failure.
  • force_abortive_close_if_mptcp(fd, stream_id) — the dispatch helper, called from every sender teardown site.

Call sites (all four sender exit paths):

  • send_data normal exit (after final tcp_info + clamp)
  • send_data error exit (after error-path clamp)
  • send_data_half normal exit (after clamp, before returning the OwnedWriteHalf)
  • send_data_half error exit (after clamp)

Order matters: fastclose runs after the bytes_sent clamp, because connect(AF_UNSPEC) resets connection state which would skew any subsequent tcpi_bytes_acked read.

Also: stopped swallowing set_linger errors silently. They now log at debug.

Why server-side receive paths are unchanged

Server's download/bidir send paths already call send_data/send_data_half and pick up the helper transparently. Server receive paths (receive_data/receive_data_half) deliberately don't get fastclose — once the client side issues MP_FASTCLOSE, the server sees RST or EOF and exits cleanly. Receiver-driven fastclose would just be teardown noise.

Verification

Unit

  • 1 new TCP-only test (force_abortive_close_if_mptcp_is_noop_on_plain_tcp) confirming the helper is a no-op on a plain TCP socket and the socket is still alive after the call.
  • All 203 existing tests pass.

Strace (loopback)

  • TCP test: 0 connect(AF_UNSPEC) calls.
  • MPTCP test: exactly 1 connect(AF_UNSPEC) per stream, sequence is setsockopt(SO_LINGER) → connect(AF_UNSPEC) → close().

End-to-end (matttbe's netns reproducer)

Side-by-side on -P 4 --mptcp -t 1sec in the same 2-path netem setup:

Metric Master This PR Delta
Wire activity duration 1.87s 1.17s −0.70s
Last packet after test end +0.71s +0.03s −0.68s
RST packets 17 109 +92 (MP_FASTCLOSE retransmits per subflow)
FIN packets 10 2 −8 (abortive, not graceful)
Wall-clock 1.29s 1.25s (same — PR #59 already fixed this)

The shift in packet mix (FINs → RSTs) and the collapse in post-deadline wire activity is MP_FASTCLOSE firing.

Test plan

  • cargo fmt --check
  • cargo clippy --all-features --all-targets -- -D warnings
  • cargo test --all-features (203 tests)
  • test-mptcp-ns.sh --ci — all functional MPTCP tests still pass
  • Side-by-side wire-level comparison vs master in matttbe's netns
  • @matttbe to confirm against his own setup (the kernel he tested on may have different default queue depths / netem behavior than mine)

Note

TCP_IS_MPTCP is hard-coded as 43 since the libc crate doesn't expose it. Value matches linux-raw-sys across all Linux architectures and the upstream UAPI header (include/uapi/linux/tcp.h).

lance0 added 3 commits April 21, 2026 00:35
Setting SO_LINGER=0 and dropping a tokio::TcpStream is enough to make
the kernel emit a RST on plain TCP, but not on MPTCP. Linux's
__mptcp_close() only routes through mptcp_do_fastclose() when the
receive queue still has unread MPTCP data or the linger timeout is
negative — neither holds for a normal upload-only test that hits its
deadline. The result was a slow graceful FIN/drain instead of an
abortive close, leaving the connection visibly active on the wire
long after the test reported complete. matttbe traced this to the
MPTCP close gating; mptcp_disconnect() (entered via
connect(fd, AF_UNSPEC)) does set MPTCP_CF_FASTCLOSE and emits
MP_FASTCLOSE on every subflow, which is what we want.

Add force_abortive_close_if_mptcp() called at every sender teardown
path (normal exit + error exit, both send_data and send_data_half).
It probes getsockopt(TCP_IS_MPTCP) and only calls connect(AF_UNSPEC)
when the kernel confirms the socket is an active MPTCP connection;
plain TCP sockets are unaffected. Order is intentional: runs after
the final tcp_info capture and bytes_sent clamp, since
connect(AF_UNSPEC) resets connection state and would skew any
subsequent tcpi_bytes_acked read.

While here, stop swallowing set_linger errors silently — log them at
debug level so a kernel that rejects SO_LINGER on a future MPTCP
variant won't leave us guessing.

Verified in the test-mptcp-ns reproducer (-P 4 --mptcp -t 1sec):
post-deadline wire activity drops from ~700ms of FIN drain to ~30ms
of MP_FASTCLOSE/RST.

TCP_IS_MPTCP (43) is hard-coded since libc doesn't expose it; matches
linux-raw-sys across architectures.

Issue #54.
The bidir failure mode flagged in review: send_data_half's fastclose
disconnects the shared socket via connect(AF_UNSPEC), which makes the
concurrent receive_data_half wake with NotConnected. Same shape applies
to peer-initiated MP_FASTCLOSE: a healthy connection mid-test sees an
ECONNRESET that previous code would have surfaced as a WARN.

Both are expected teardown, not real errors. Widen is_peer_closed_error
to include NotConnected (the local-side symptom of our own fastclose),
and have receive_data and receive_data_half treat any peer-closed-style
error as a suppressed-teardown break, regardless of whether cancel has
fired yet. cancelled is set from *cancel.borrow() so drain_after_cancel
still only runs for genuine cancel paths.

Trade-off acknowledged: a real mid-test peer reset (NAT timeout, etc.)
no longer surfaces as Err from receive_data; it's counted as a
suppressed teardown error and the function returns Ok. The control-
plane result message and the suppressed-teardown debug counter still
expose serious failures. Better than logging every MPTCP fastclose as
an error.

Also:
- Restore the [0.9.9] release heading that an earlier Edit accidentally
  consumed when adding the new Unreleased entry.
- Delete the dead non-Linux force_abortive_close_if_mptcp stub. All
  call sites were already inside #[cfg(target_os = "linux")] blocks.
- Add receive_data_suppresses_peer_initiated_reset regression test:
  client side sets SO_LINGER=0 and drops, server-side receive_data
  must return Ok rather than Err on the resulting RST. cancel is never
  fired so the assertion proves the suppression — not the cancel
  branch — is what made the function exit cleanly.
TCP_IS_MPTCP only landed in Linux 6.10. xfr advertises MPTCP support
for 5.6+, so on 5.6-6.9 the fastclose path was a silent no-op even
though the underlying connect(AF_UNSPEC) trick works there too. This
silently ate the fix for users on Ubuntu 22.04 (5.15) and similar
LTS-era kernels with MPTCP backports.

Add a second probe: getsockopt(SOL_MPTCP, MPTCP_INFO) which has been
present since Linux 5.16. Succeeds on actual MPTCP sockets, returns
EOPNOTSUPP on plain TCP. We don't read the contents — just check the
return code. Buffer is oversized (256 bytes) to absorb future struct
growth without recompiling.

Coverage matrix after this change:
- 6.10+: TCP_IS_MPTCP path (fast, unambiguous).
- 5.16-6.9: MPTCP_INFO fallback path. Adds one extra getsockopt for
  pre-6.10 plain TCP teardowns; negligible.
- 5.6-5.15: neither probe; falls through to graceful close, same as
  prior behavior.

Verified locally on Linux 6.17: --mptcp test still emits exactly 1
connect(AF_UNSPEC) per stream; plain TCP test emits 0.

PR #67 review follow-up (Codex medium finding).
@lance0
lance0 merged commit 53b9928 into master Apr 21, 2026
7 checks passed
@lance0
lance0 deleted the mptcp-close-investigation branch April 21, 2026 05:02
matttbe added a commit to matttbe/xfr that referenced this pull request Apr 21, 2026
…ation"

This reverts commit 53b9928, reversing
changes made to 7936775.

There shouldn't be any specific cases for MPTCP to force a connection to
reset: it should behave like TCP. If not, there is a bug on the kernel
side.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
lance0 added a commit that referenced this pull request Apr 21, 2026
Revert "Merge pull request #67 from lance0/mptcp-close-investigation"
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 22, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 22, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 23, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 23, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 24, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 24, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 24, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 24, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 27, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 28, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Apr 29, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 29, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp_net-next that referenced this pull request Apr 29, 2026
The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 12, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 12, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 12, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 12, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 13, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 13, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this pull request May 14, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
woodsts pushed a commit to woodsts/linux-stable that referenced this pull request May 14, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
woodsts pushed a commit to woodsts/linux-stable that referenced this pull request May 14, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
woodsts pushed a commit to woodsts/linux-stable that referenced this pull request May 14, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
daunabomba pushed a commit to daunabomba/linux that referenced this pull request May 14, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
opsiff pushed a commit to deepin-community/kernel that referenced this pull request May 15, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 4f269fc3c73af49aa3ee7769ab5d3e94fc7bba57)
Signed-off-by: Wentao Guan <[email protected]>
opsiff pushed a commit to deepin-community/kernel that referenced this pull request May 15, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 1d259bc7cc87494b7e757c373e955494de605d06)
Signed-off-by: Wentao Guan <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 15, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
mj22226 pushed a commit to mj22226/linux that referenced this pull request May 15, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Whissi pushed a commit to Whissi/linux-stable that referenced this pull request May 17, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
marcoodhb pushed a commit to marcoodhb/konoha-kernel-gki that referenced this pull request May 22, 2026
commit f14d6e9c3678a067f304abba561e0c5446c7e845 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
opsiff pushed a commit to opsiff/UOS-kernel that referenced this pull request May 27, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 114b4a6d4ede56b4653751aa51fe1df4028036e2)
Signed-off-by: Wentao Guan <[email protected]>
opsiff pushed a commit to deepin-community/kernel that referenced this pull request May 27, 2026
commit f14d6e9 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 114b4a6d4ede56b4653751aa51fe1df4028036e2)
Signed-off-by: Wentao Guan <[email protected]>
pkking pushed a commit to openeuler-mirror/Intel-kernel that referenced this pull request Jun 4, 2026
stable inclusion
from stable-v6.6.140
commit 114b4a6d4ede56b4653751aa51fe1df4028036e2
category: bugfix
bugzilla: https://atomgit.com/openeuler/kernel/issues/

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=114b4a6d4ede56b4653751aa51fe1df4028036e2

--------------------------------

commit f14d6e9c3678a067f304abba561e0c5446c7e845 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Wang Hai <[email protected]>
vicamo pushed a commit to canonical/hwe-packages-build-helpers that referenced this pull request Jun 14, 2026
BugLink: https://bugs.launchpad.net/bugs/2156549

commit f14d6e9c3678a067f304abba561e0c5446c7e845 upstream.

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Alice C. Munduruca <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
kernel-patches-daemon-bpf Bot pushed a commit to kernel-patches/linux-stable that referenced this pull request Jun 16, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kernel-patches-daemon-bpf Bot pushed a commit to kernel-patches/linux-stable that referenced this pull request Jun 17, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
johnny-mnemonic pushed a commit to linux-ia64/linux-stable-rc that referenced this pull request Jun 17, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kernel-patches-daemon-bpf Bot pushed a commit to kernel-patches/linux-stable that referenced this pull request Jun 18, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kernel-patches-daemon-bpf Bot pushed a commit to kernel-patches/linux-stable that referenced this pull request Jun 18, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kernel-patches-daemon-bpf Bot pushed a commit to kernel-patches/linux-stable that referenced this pull request Jun 18, 2026
[ Upstream commit f14d6e9 ]

The SO_LINGER socket option has been supported for a while with MPTCP
sockets [1], but it didn't cause the equivalent of a TCP reset as
expected when enabled and its time was set to 0. This was causing some
behavioural differences with TCP where some connections were not
promptly stopped as expected.

To fix that, an extra condition is checked at close() time before
sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.

Note that backporting up to [1] will be difficult as more changes are
needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
which was supposed to already imitate TCP.

Validated with MPTCP packetdrill tests [3].

Fixes: 268b123 ("mptcp: setsockopt: support SO_LINGER") [1]
Fixes: d21f834 ("mptcp: use fastclose on more edge scenarios") [2]
Cc: [email protected]
Reported-by: Lance Tuller <[email protected]>
Closes: lance0/xfr#67
Link: multipath-tcp/packetdrill#196 [3]
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
[ kept `mptcp_check_readable()` name and explicit `inet_sk_state_store(sk, TCP_CLOSE)` ]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant