Skip to content

M4a - #9

Merged
mp0rta merged 21 commits into
mainfrom
m4a
Oct 13, 2026
Merged

M4a#9
mp0rta merged 21 commits into
mainfrom
m4a

Conversation

@mp0rta

@mp0rta mp0rta commented Oct 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

mp0rta added 21 commits October 13, 2026 00:09
A passive TCB returns to LISTEN on an in-window SYN (RFC 9293
L3652-3658), and a reset the hooks request while the final ACK is
processed is returned as Closed(Reset), not Established.
RFC 9293 L3340-3346: in LISTEN such a segment is dropped, not answered with a RST.
Listener side of the MP_CAPABLE negotiation (spec G2, G2a, G2b, G6, G7):
syn_capable decides the SYN row, the key is drawn through the token map
when the SYN creates the half-open, the SYN/ACK carries it (length 12,
flags exactly H), and the segment that completes the handshake confirms
(capable_ack_ok, length 20 or 22) or falls back. AwaitingKey -> Confirmed
then shares every post-handshake path with the client. capable_ack_ok also
guards later MP_CAPABLE data mappings. Outgoing joins wait for a DSS from
the peer (peer_dss_seen, RFC 8684 L884-887).

App, run_apps and the segment predicates move from server_tcp.rs into the
shared test support.
…r rejects any invalid later MP_CAPABLE

The listener's key decision now follows the option-list validation: a
final ACK whose options are rejected falls back consistently (FellBack,
Accepted { mptcp: false }, payload as plain TCP, no C bit taken). A
later MP_CAPABLE that fails capable_ack_ok resets the listener's subflow
with or without data parameters; the initiator keeps ignoring one
without data parameters.
A listener answers MP_JOIN SYNs (RFC 8684 §3.2): the token alone picks the
connection, whatever its role and source address; the SYN/ACK carries
HMAC-B, the third ACK's HMAC-A completes the join, and retransmitted third
ACKs draw a plain ACK. Unknown token, unconfirmed or closing connection, a
listener without MPTCP or at its half-open cap: RST with MP_TCPRST 0x01;
subflow cap: 0x02. Incoming, outgoing and queued joins share SUBFLOW_CAP
(Connection::subflow_slots). The peer's backup request and window scale
come from the SYN. unlisten resets the joins it was answering.
…close

A valid MP_FASTCLOSE on a join the responder is still answering tears the
connection down (RFC 8684 L2191-2196) instead of only failing the join.
A connection whose application has closed takes joins while it is live.
Every per-connection feature on an accepted connection (spec G8), each
mirroring a client-side outcome with the roles swapped: close from either
side, abort/MP_FASTCLOSE from either side, the single-subflow stripping
fallback, stripping on a joined subflow, an infinite mapping with a join,
MP_PRIO and close_subflow from the server, REMOVE_ADDR and ADD_ADDR seen by
the server, and CUBIC/BBRv3 4 MiB each way over lossy links with five seeds.
The harness gains run_apps_until. No shared-code fix was needed.
After a fallback our infinite mapping went out once, on the next segment,
often a pure ACK, and was never resent. If that segment was lost or data
overtook it, the peer TCP-ACKed and discarded the unmapped octets and the
stream was silently truncated (seed 48 of the single-subflow stripping test:
4296 of 200000 octets, then Closed { Normal }).

Every data segment not below the mapping, retransmissions included, now
carries it until the peer's TCP ACK passes the first data sent after the
switch (RFC 8684 L2406-2407); the ACK-only copy stays. Client tests that
pinned "one segment" / "plain TCP after the switch" now accept the repeated
mapping; two scripted regression tests cover loss and overtaking, and the
server fallback tests run over lossy links again (seed 48 included).
mptcp-rs-tun --listen IP:PORT accepts one connection (later ones are
aborted) and transfers like client mode, ending with the server contract
line check.py parses. run.sh INTEROP_SERVER=mptcp-rs runs it on a TUN in
srv as 10.0.7.2 for base-a, m1, m2-goodput, m2-lossy and the new
m2-remove (kernel client deletes its leg-B endpoint after 10 s).
check.py takes --client/--server; endpoints.py holds the address table
and the m2-remove exemption for the removed subflow.
With --listen, an unparsable --local/--remote became "not given" and
passed the role check. Any given address flag must now parse.
A final ACK that confirms MPTCP and then fails (a data_len 0 mapping)
resets the half-open connection, which released its listener slot but
was kept by handle_timeout for the no-subflow wait, with its token and
demux entry. Repeated, this bypassed max_half_open (spec G9) with no
handle for the application to abort it (spec G10). A half-open
connection is now never retained or detached.
An MP_CAPABLE the parser rejects ended the option walk before the
listener's check for an invalid later MP_CAPABLE, so a Confirmed
server subflow survived it. Past the handshake, a malformed MP_CAPABLE
now resets a passive subflow like an invalid well-formed one; the
initiator still ignores it.
Tcb::close leaves SYN-RECEIVED unchanged (FIN-WAIT-1 would skip the
third ACK's HMAC check), so a join we answered whose third ACK was lost
outlived a connection closed both ways at the data level, holding its
listener slot until its SYN timeout. prepare_send now resets it with
MP_TCPRST (unspecified) once data_closed(); with only our DATA_FIN
acked it waits as before, since it may still carry the peer's data.
Let chains are stable only from Rust 1.88.
@mp0rta
mp0rta merged commit 45266d7 into main Oct 13, 2026
14 checks passed
@mp0rta
mp0rta deleted the m4a branch October 13, 2026 09:27
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