Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow stateless operations on a binding until fully initialized #1928

Merged
merged 4 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/core/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ QuicBindingInitialize(

*NewBinding = Binding;
Status = QUIC_STATUS_SUCCESS;
InterlockedIncrement16(&Binding->Initialized);
thhous-msft marked this conversation as resolved.
Show resolved Hide resolved

Error:

Expand Down Expand Up @@ -631,6 +632,10 @@ QuicBindingCreateStatelessOperation(

CxPlatDispatchLockAcquire(&Binding->StatelessOperLock);

if (!Binding->Initialized) {
goto Exit;
}

//
// Age out all expired operation contexts.
//
Expand Down
6 changes: 6 additions & 0 deletions src/core/binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ typedef struct QUIC_BINDING {
//
BOOLEAN Connected : 1;

//
// Indicates that the binding is fully initialized. Not as part of the above
// bitfield as its accessed from multiple threads.
//
int16_t Initialized;

//
// Number of (connection and listener) references to the binding.
//
Expand Down