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

Go to COOKIE_WAIT after T1-init start #310

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all 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
7 changes: 6 additions & 1 deletion association.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ func (a *Association) init(isClient bool) {
go a.writeLoop()

if isClient {
a.setState(cookieWait)
init := &chunkInit{}
init.initialTSN = a.myNextTSN
init.numOutboundStreams = a.myMaxNumOutboundStreams
Expand All @@ -398,6 +397,11 @@ func (a *Association) init(isClient bool) {
a.log.Errorf("[%s] failed to send init: %s", a.name, err.Error())
}

// After sending the INIT chunk, "A" starts the T1-init timer and enters the COOKIE-WAIT state.
// Note: ideally we would set state after the timer starts but since we don't do this in an atomic
// set + timer-start, it's safer to just set the state first so that we don't have a timer expiration
// race.
a.setState(cookieWait)
edaniels marked this conversation as resolved.
Show resolved Hide resolved
a.t1Init.start(a.rtoMgr.getRTO())
}
}
Expand Down Expand Up @@ -1175,6 +1179,7 @@ func (a *Association) handleInit(p *packet, i *chunkInit) ([]*packet, error) {
outbound.destinationPort = a.destinationPort

initAck := &chunkInitAck{}
a.log.Debug("sending INIT ACK")

initAck.initialTSN = a.myNextTSN
initAck.numOutboundStreams = a.myMaxNumOutboundStreams
Expand Down
Loading