diff --git a/association.go b/association.go index 9b2aad55..1ad4566d 100644 --- a/association.go +++ b/association.go @@ -366,7 +366,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 @@ -386,7 +385,9 @@ 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. a.t1Init.start(a.rtoMgr.getRTO()) + a.setState(cookieWait) } } @@ -1155,6 +1156,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