summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/testing/context
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/transport/tcp/testing/context')
-rw-r--r--pkg/tcpip/transport/tcp/testing/context/context.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/testing/context/context.go b/pkg/tcpip/transport/tcp/testing/context/context.go
index 8ac411b1d..6e2fed880 100644
--- a/pkg/tcpip/transport/tcp/testing/context/context.go
+++ b/pkg/tcpip/transport/tcp/testing/context/context.go
@@ -234,6 +234,10 @@ func (c *Context) GetPacket() []byte {
copy(b, p.Header)
copy(b[len(p.Header):], p.Payload)
+ if p.GSO != nil && p.GSO.L3HdrLen != header.IPv4MinimumSize {
+ c.t.Errorf("L3HdrLen %v (expected %v)", p.GSO.L3HdrLen, header.IPv4MinimumSize)
+ }
+
checker.IPv4(c.t, b, checker.SrcAddr(StackAddr), checker.DstAddr(TestAddr))
return b
@@ -956,3 +960,8 @@ func (c *Context) SACKEnabled() bool {
}
return bool(v)
}
+
+// SetGSOEnabled enables or disables generic segmentation offload.
+func (c *Context) SetGSOEnabled(enable bool) {
+ c.linkEP.GSO = enable
+}