fix timewait not counting as closed state in listen open; add second part to test

This commit is contained in:
soypat
2025-10-24 18:26:59 -03:00
parent 92a245957b
commit 3fa2f32737
2 changed files with 25 additions and 9 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ type recvSpace struct {
// To open an active connection use [ControlBlock.Send] with a segment generated with [ClientSynSegment].
func (tcb *ControlBlock) Open(iss Value, wnd Size) (err error) {
switch {
case tcb._state != StateClosed && tcb._state != StateListen:
case tcb._state != StateClosed && tcb._state != StateTimeWait:
err = errNeedClosedTCBToOpen
case wnd > math.MaxUint16:
err = errWindowTooLarge