Skip to content

Vendors: pin MafiaNet v0.16.0 for the tunnelled-client MTU fix - #266

Merged
Segfaultd merged 1 commit into
developfrom
fix/mafianet-0.16.0-mtu
Aug 31, 2026
Merged

Vendors: pin MafiaNet v0.16.0 for the tunnelled-client MTU fix#266
Segfaultd merged 1 commit into
developfrom
fix/mafianet-0.16.0-mtu

Conversation

@Segfaultd

@Segfaultd Segfaultd commented Aug 31, 2026

Copy link
Copy Markdown
Member

Pins MafiaNet to v0.16.0, which fixes players behind a VPN being unable to connect.

Why

MafiaNet negotiated the path MTU in one direction only — the connecting peer padded ID_OPEN_CONNECTION_REQUEST_1 down its ladder, the accepting peer echoed back whatever size arrived — then froze that value for the life of the connection and applied it to both directions, with no black-hole detection afterwards. A datagram too large for the return path was resent at the same size until the connection timed out.

Every handshake packet is small enough to survive that, so the failure landed on the first split payload instead: the peer connected and then hung or dropped. Which tunnelled players it hit depended entirely on their exit node's encapsulation overhead — WireGuard 1420, Tailscale and many providers 1280, IKEv2 ~1400 — against MafiaNet's old top rung of 1492. That is why it looked intermittent.

v0.16.0 caps the negotiated MTU at 1400, adds finer rungs (1280, 1024) so stepping down costs less payload capacity, and clamps an MTU reported by a remote peer — previously guarded only by a RakAssert, so a release build would adopt an MTU of 65535 from a single forged, unauthenticated datagram. It also fixes a dead WSAEMSGSIZE check, a stalled sendto abandoning a connection attempt outright, and a latent divide-by-zero in Connect().

Compatibility

Wire-compatible. RAKNET_PROTOCOL_VERSION stays at 7 and no message ids move.

Two peers converge on the smaller of their two caps, because the accepting side clamps to its own MAXIMUM_MTU_SIZE before replying and both sides clamp what they are told. A server built on this pin caps every connection — including clients still built against 0.15.0 — with no client update required.

On the version bump

bump_version.sh classifies this as a major Framework bump because it touches cmake/MafiaNetPin.cmake. That rule is a deliberate proxy for "the wire format may have moved", and the pin file documents it as such. It has not moved here — the protocol version is unchanged and the MTU is negotiated per connection, never part of the packet format — so the major classification is the tooling being conservative by design rather than a real break. Flagging it rather than working around it.

Verification

  • builds\build.bat M2OServer 64 builds clean against the new pin.
  • The fetched tree under _deps/mafianet-src is at 667fa4e9 (chore(release): v0.16.0) with MAXIMUM_MTU_SIZE 1400, confirming the pin actually moved rather than reusing the cached 0.15.0 checkout.
  • Upstream: 137/137 unit and 49/49 integration on Windows, plus MafiaNet CI green on Linux (Debug and Release), macOS and Windows.

Summary by CodeRabbit

  • Chores
    • Updated the bundled MafiaNet networking dependency to version 0.16.0.
    • Network behavior remains wire-compatible, with improved MTU handling capped at 1400.

Players behind a VPN could not connect. MafiaNet negotiated the path MTU
in one direction only, then froze it for the life of the connection and
applied it to both -- with no black-hole detection afterwards, so a
datagram too large for the return path was resent at the same size until
the connection timed out. Handshake packets are small enough to survive
that, so the failure landed on the first split payload: the peer
connected and then hung or dropped.

v0.16.0 caps the negotiated MTU at 1400, which clears WireGuard and
typical IPSec/IKEv2 tunnels, and clamps an MTU reported by a remote peer
-- previously guarded only by a RakAssert, so a release build would adopt
65535 from a single forged datagram.

Wire-compatible: RAKNET_PROTOCOL_VERSION stays at 7 and no message ids
move. Peers converge on the smaller of their two caps, so a server built
on this pin caps every connection, including clients still built against
0.15.0, with no client update needed.

Note the bump is classified major by bump_version.sh because it touches
MafiaNetPin.cmake. That rule is a deliberate proxy for "the wire format
may have moved", which it has not here; the classification is
conservative rather than protocol-mandated.

Verified: M2OServer 64 builds against the new pin, and the fetched tree
is at 667fa4e9 with MAXIMUM_MTU_SIZE 1400.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 359e0734-fdcf-468c-8ed1-783cc76589d7

📥 Commits

Reviewing files that changed from the base of the PR and between dbf2465 and beb8146.

📒 Files selected for processing (1)
  • cmake/MafiaNetPin.cmake

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The CMake configuration updates MafiaNet from v0.15.0 to v0.16.0. The new comment records an MTU cap of 1400 and preserved RAKNET_PROTOCOL_VERSION wire compatibility.

Changes

MafiaNet dependency update

Layer / File(s) Summary
Update MafiaNet version pin
cmake/MafiaNetPin.cmake
The MAFIANET_PIN value changes to the v0.16.0 commit. The comment records the MTU cap and wire compatibility.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to beb81

This localized dependency pin adopts MafiaNet v0.16.0 for the tunnelled-client MTU fix while preserving wire compatibility; no actionable merge-blocking risk remains beyond normal checks and review.

Poem

A rabbit checks the pinned commit

v0.16.0 hops into place
MTU stays neatly capped
Wire compatibility keeps pace
One small CMake change
Then carrots for the build sage

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the MafiaNet vendor pin to v0.16.0 and the tunnelled-client MTU fix, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mafianet-0.16.0-mtu

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Segfaultd
Segfaultd merged commit fc6ccfa into develop Aug 31, 2026
6 checks passed
@Segfaultd
Segfaultd deleted the fix/mafianet-0.16.0-mtu branch August 31, 2026 14:28
@Segfaultd
Segfaultd restored the fix/mafianet-0.16.0-mtu branch August 31, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants