summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBrian Geffon <bgeffon@google.com>2018-05-23 15:00:59 -0700
committerShentubot <shentubot@google.com>2018-05-23 15:01:48 -0700
commit7996ae7ccf284718fc98f5ba34c94b044b858ec2 (patch)
tree5d2b12b53a716347ea74157b5d0513157ea6ec4d
parent02ad0dc3d9909fb93dd41d7f8976be4fc54a99d5 (diff)
Adding test case for RST acceptable ack panic
PiperOrigin-RevId: 197795613 Change-Id: I759dd04995d900cba6b984649fa48bbc880946d6
-rw-r--r--pkg/tcpip/transport/tcp/tcp_test.go13
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) {