Skip to content

fix: refresh repeated RakNet challenges#60

Open
RestartFU wants to merge 4 commits into
Sandertv:masterfrom
RestartFU:agent/repeated-open-connection-reply1
Open

fix: refresh repeated RakNet challenges#60
RestartFU wants to merge 4 commits into
Sandertv:masterfrom
RestartFU:agent/repeated-open-connection-reply1

Conversation

@RestartFU

Copy link
Copy Markdown
Contributor

Summary

  • handle OpenConnectionReply1 during the Request2 phase
  • refresh the negotiated MTU, security flag, and cookie
  • resend Request2 immediately through the existing sender

Problem

Some protected RakNet endpoints issue another Reply1 after receiving the
first Request2. That reply carries a replacement security cookie. The dialer
currently ignores it and keeps retrying Request2 with the stale cookie until
the connection deadline expires.

Observed packet flow before the fix:

Reply1(cookie A) -> Request2(cookie A) -> Reply1(cookie B)
-> Request2(cookie A) ... timeout

After refreshing the Request2 state:

Reply1(cookie A) -> Request2(cookie A) -> Reply1(cookie B)
-> Request2(cookie B) -> Reply2

Scope

This only fixes the initial open-connection handshake. Reconnect teardown and
expired-reader behavior are intentionally excluded.

Validation

  • live UDP packet trace against a protected Bedrock endpoint
  • gofmt -w dial.go
  • git diff --check
  • no automated tests added

Protected endpoints may answer Request2 with another Reply1 and a new
security cookie. Resend Request2 with the replacement handshake state
instead of retrying stale values.
@RestartFU
RestartFU marked this pull request as ready for review July 17, 2026 13:50
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