Commit Graph
1 Commits
Author SHA1 Message Date
Chris 41cedb89d6 Only intercept ENet disconnects addressed to our peer (#162)
ignoreDisconnectIntercept() runs on every datagram the control stream
socket receives, before ENet has validated the packet. It only checked
the length and command, so any 12-byte DISCONNECT from any source set
disconnectPending, which tears down the session about a second later.

Check that the header's peer ID and session ID match our peer and that
the packet came from the peer's current address before acting on it.
Anything else is passed to ENet unchanged, so a genuine disconnect that
does not match (for example from another address of a multi-homed
host) is still handled, just without the grace period.
2026-10-24 18:16:28 -05:00