Skip to content

mptcp: validate MPTcpExtInvalidOptionRx on MP_CAPABLE fallback paths - #205

Draft
Dwyane-Yan wants to merge 1 commit into
multipath-tcp:mptcp-net-nextfrom
Dwyane-Yan:mptcp-invalid-option-rx
Draft

mptcp: validate MPTcpExtInvalidOptionRx on MP_CAPABLE fallback paths#205
Dwyane-Yan wants to merge 1 commit into
multipath-tcp:mptcp-net-nextfrom
Dwyane-Yan:mptcp-invalid-option-rx

Conversation

@Dwyane-Yan

Copy link
Copy Markdown

The mptcp_net-next kernel now increments the MPTcpExtInvalidOptionRx MIB counter whenever the MPTCP option parser ignores an option due to a wrong version, disallowed flags, bad length, etc.

These four packetdrill tests already inject malformed MP_CAPABLE options that are rejected by the parser, causing a TCP fallback:

  • v1_bind_tcpfallback_wrongver: v0 SYN (version < v1)
  • v1_connect_tcpfallback_wrongver: v0 SYN-ACK (version != v1)
  • v1_bind_tcpfallback_flagB: extensibility flag set
  • v1_bind_tcpfallback_flagH: HMAC-SHA256 flag missing

Extend their nstat validation to also check that MPTcpExtInvalidOptionRx has been incremented. The connect-side wrong-version test had no nstat section, so add the nstat -n initialization along with the new assertion.

Assisted-by: Claude: GLM-5.2

The mptcp_net-next kernel now increments the MPTcpExtInvalidOptionRx MIB
counter whenever the MPTCP option parser ignores an option due to a wrong
version, disallowed flags, bad length, etc.

These four packetdrill tests already inject malformed MP_CAPABLE options
that are rejected by the parser, causing a TCP fallback:

  - v1_bind_tcpfallback_wrongver:    v0 SYN     (version < v1)
  - v1_connect_tcpfallback_wrongver: v0 SYN-ACK (version != v1)
  - v1_bind_tcpfallback_flagB:       extensibility flag set
  - v1_bind_tcpfallback_flagH:       HMAC-SHA256 flag missing

Extend their nstat validation to also check that MPTcpExtInvalidOptionRx
has been incremented. The connect-side wrong-version test had no nstat
section, so add the `nstat -n` initialization along with the new
assertion.

Assisted-by: Claude: GLM-5.2
Signed-off-by: Gang Yan <yangang@kylinos.cn>
@Dwyane-Yan Dwyane-Yan closed this Aug 13, 2026
@matttbe

matttbe commented Aug 13, 2026

Copy link
Copy Markdown
Member

Thank you for this PR. Indeed, all of them should not have the MIB counter increased. Maybe we could keep this PR but check that the counter is 0 as expected?

We could also have another test sending invalid options, e.g. 2 different DSS (if packetdrill allows that in the current implementation) or an MPC + a DSS, etc.

Note that on my side, I called the counter OptInvalidOpt for the prefix just in case other Opt related are added, and no Rx because I don't see why we would have invalid options on the output side :)

@Dwyane-Yan

Copy link
Copy Markdown
Author

Sounds good, I can do this after your patches are sent to the mail list.

Thanks

@matttbe

matttbe commented Aug 14, 2026

Copy link
Copy Markdown
Member

Thanks!

Reopening and converting to a draft, just not to forget about it.

@matttbe matttbe reopened this Aug 14, 2026
@matttbe
matttbe marked this pull request as draft August 14, 2026 22:38
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.

2 participants