Fixed: reject RID for id=0 if not rendezvous #2562
Merged
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.
Fixes #2557
The problem: The "rendezvous queue" has been serving in UDT for actually two purposes: beside rendezvous, it was also used to handle caller sockets in non-blocking mode (blocking mode for caller sockets' handling was executed completely in a loop in
CUDT::startConnect
). This was a procedure used for the following situations in response to an incoming handshake packet:This means: in order to handle all these 3 cases, the lookup in the rendezvous queue in case when the incoming ID is 0 should succeed only in case when the found socket is rendezvous.
BTW. Further research: it shouldn't be allowed to bind two sockets to the same address if any of these sockets is rendezvous. The rendezvous sockets should have a nonshareable binding regardless of the value of the
SRTO_REUSEADDR
option (might be that this option should be set automatically to false when setting rendezvous, and setting rendezvous should not be allowed on a socket that already has a shared binding).