diff options
author | Andrei Vagin <avagin@google.com> | 2019-04-18 11:40:34 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-04-18 11:42:23 -0700 |
commit | 4524790ff668674149ad6ae6eec805369be0c6e3 (patch) | |
tree | fe2145a8e9c70d645614ad2d47ea8260af17cbbf /pkg/tcpip/link/fdbased | |
parent | b52cbd60280342f25411561702e97fe650fdaa9c (diff) |
netstack: use a proper network protocol to set gso.L3HdrLen
It is possible to create a listening socket which will accept
IPv4 and IPv6 connections. In this case, we set IPv6ProtocolNumber
for all accepted endpoints, even if they handle IPv4 connections.
This means that we can't use endpoint.netProto to set gso.L3HdrLen.
PiperOrigin-RevId: 244227948
Change-Id: I5e1863596cb9f3d216febacdb7dc75651882eef1
Diffstat (limited to 'pkg/tcpip/link/fdbased')
-rw-r--r-- | pkg/tcpip/link/fdbased/endpoint_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/tcpip/link/fdbased/endpoint_test.go b/pkg/tcpip/link/fdbased/endpoint_test.go index 5a06c6387..c8b037d57 100644 --- a/pkg/tcpip/link/fdbased/endpoint_test.go +++ b/pkg/tcpip/link/fdbased/endpoint_test.go @@ -166,6 +166,7 @@ func testWritePacket(t *testing.T, plen int, eth bool, gsoMaxSize uint32) { CsumOffset: csumOffset, MSS: gsoMSS, MaxSize: gsoMaxSize, + L3HdrLen: header.IPv4MaximumHeaderSize, } } if err := c.ep.WritePacket(r, gso, hdr, payload.ToVectorisedView(), proto); err != nil { |