diff options
author | Brian Geffon <bgeffon@google.com> | 2018-05-23 15:00:59 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-05-23 15:01:48 -0700 |
commit | 7996ae7ccf284718fc98f5ba34c94b044b858ec2 (patch) | |
tree | 5d2b12b53a716347ea74157b5d0513157ea6ec4d /pkg/tcpip/transport/tcp | |
parent | 02ad0dc3d9909fb93dd41d7f8976be4fc54a99d5 (diff) |
Adding test case for RST acceptable ack panic
PiperOrigin-RevId: 197795613
Change-Id: I759dd04995d900cba6b984649fa48bbc880946d6
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r-- | pkg/tcpip/transport/tcp/tcp_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_test.go b/pkg/tcpip/transport/tcp/tcp_test.go index 3c21a1ec3..8c54310f2 100644 --- a/pkg/tcpip/transport/tcp/tcp_test.go +++ b/pkg/tcpip/transport/tcp/tcp_test.go @@ -400,7 +400,20 @@ func TestRstOnCloseWithUnreadData(t *testing.T) { checker.TCP( checker.DstPort(context.TestPort), checker.TCPFlags(header.TCPFlagAck|header.TCPFlagRst), + // We shouldn't consume a sequence number on RST. + checker.SeqNum(uint32(c.IRS)+1), )) + + // This final should be ignored because an ACK on a reset doesn't + // mean anything. + c.SendPacket(nil, &context.Headers{ + SrcPort: context.TestPort, + DstPort: c.Port, + Flags: header.TCPFlagAck, + SeqNum: seqnum.Value(790 + len(data)), + AckNum: c.IRS.Add(seqnum.Size(2)), + RcvWnd: 30000, + }) } func TestFullWindowReceive(t *testing.T) { |