When sending a RST the acceptable ACK window shouldn't change.

Today when we transmit a RST it's happening during the time-wait
flow. Because a FIN is allowed to advance the acceptable ACK window
we're incorrectly doing that for a RST.

PiperOrigin-RevId: 197637565
Change-Id: I080190b06bd0225326cd68c1fbf37bd3fdbd414e
This commit is contained in:
Brian Geffon
2018-05-22 15:52:41 -07:00
committed by Shentubot
parent 7b2b7a3946
commit 257ab8de93
+4 -2
View File
@@ -342,15 +342,17 @@ func (s *sender) sendData() {
s.ep.mu.Lock()
// We're sending a FIN by default
fl := flagFin
segEnd = seg.sequenceNumber
if (s.ep.shutdownFlags&tcpip.ShutdownRead) != 0 && rcvBufUsed > 0 {
// If there is unread data we must send a RST.
// For more information see RFC 2525 section 2.17.
fl = flagRst
} else {
segEnd = seg.sequenceNumber.Add(1)
}
s.ep.mu.Unlock()
seg.flags |= uint8(fl)
segEnd = seg.sequenceNumber.Add(1)
} else {
// We're sending a non-FIN segment.
if !seg.sequenceNumber.LessThan(end) {