tcp: bugfix for missing ack for window rejected segments (#45)

This commit is contained in:
Pat Whittingslow
2026-02-28 19:21:07 +01:00
committed by GitHub
parent 989bb6a0b9
commit 3d0bc93cbe
2 changed files with 160 additions and 0 deletions
+8
View File
@@ -445,6 +445,14 @@ func (tcb *ControlBlock) validateIncomingSegment(seg Segment) (err error) {
err = errRequireSequential
}
if err != nil {
// RFC 9293 §3.4: If segment not acceptable, send ACK (unless RST).
switch err {
case errSeqNotInWindow, errLastNotInWindow, errRequireSequential, errZeroWindow:
if !flags.HasAny(FlagRST) {
tcb.challengeAck = true
tcb.pending[0] |= FlagACK
}
}
return err
}
if flags.HasAny(FlagRST) {