mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user