summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/testing/context
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2019-11-28 17:13:46 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-28 17:15:07 -0800
commit10bbcf97d25b824aa0565af114e3272d3e314d19 (patch)
tree323fde2833121c9fff078fb6cbcb1d59c9b9851a /pkg/tcpip/transport/tcp/testing/context
parent684f757a228f88e5fabe6ebe6ed54f0db20fd63d (diff)
Test handling segments on completed but not yet accepted TCP connections
This change does not introduce any new features, or modify existing ones. This change tests handling TCP segments right away for connections that were completed from a listening endpoint. PiperOrigin-RevId: 282986457
Diffstat (limited to 'pkg/tcpip/transport/tcp/testing/context')
-rw-r--r--pkg/tcpip/transport/tcp/testing/context/context.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/testing/context/context.go b/pkg/tcpip/transport/tcp/testing/context/context.go
index 04fdaaed1..6cb66c1af 100644
--- a/pkg/tcpip/transport/tcp/testing/context/context.go
+++ b/pkg/tcpip/transport/tcp/testing/context/context.go
@@ -1089,3 +1089,9 @@ func (c *Context) SetGSOEnabled(enable bool) {
func (c *Context) MSSWithoutOptions() uint16 {
return uint16(c.linkEP.MTU() - header.IPv4MinimumSize - header.TCPMinimumSize)
}
+
+// MSSWithoutOptionsV6 returns the value for the MSS used by the stack when no
+// options are in use for IPv6 packets.
+func (c *Context) MSSWithoutOptionsV6() uint16 {
+ return uint16(c.linkEP.MTU() - header.IPv6MinimumSize - header.TCPMinimumSize)
+}