Ignore out of order packts during UDP connection in Reverse Mode #1260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
master
or3.1-STABLE
) to which this pull request applies:Latest 3.10+
#1123, #1212 and probably #914, #1182
Based on the analysis done by @aahoward in #1123. In UDP Reverse mode, the server starts sending the UDP packets immediately after sending the Connect response. Sometimes, before network packets reordering, the first UDP packet arrives to the client before the Connection response. In this case the client wrongly handles the first packet as the connection response.
The proposed solution is that the client will wait until receiving the connect response. Current implementation is that the client allows one packet out of order (hardcoded as it seems that the chance that two packets will arrive before the connection response is minimal). It is also assumed that the first packets does not include the 4 bytes connection response static value in a 4 bytes alignment offset.
Note that based on a suggestion in a previous issue (I couldn't find it now) I changed the connection and response 4 bytes messages values to textual value, to allow easier Wireshark, etc. readability.