summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/forwarder_test.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2020-03-10 17:50:47 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-10 17:52:31 -0700
commitf56fe66b13b979f2ac96e8fce6fb0a5dec9a32e0 (patch)
treee73883f0d5b4f56eefee4eea8755592332d1f3a4 /pkg/tcpip/stack/forwarder_test.go
parentd6440ec5a125746b76f189c0a5d5946dde9afc37 (diff)
Honour the link's MaxHeaderLength when forwarding
This change also updates where the IP packet buffer is held in an outbound tcpip.PacketBuffer from Header to Data. This change removes unncessary copying of the IP packet buffer when forwarding. Test: stack_test.TestNICForwarding PiperOrigin-RevId: 300217972
Diffstat (limited to 'pkg/tcpip/stack/forwarder_test.go')
-rw-r--r--pkg/tcpip/stack/forwarder_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/tcpip/stack/forwarder_test.go b/pkg/tcpip/stack/forwarder_test.go
index 321b7524d..5a04590d5 100644
--- a/pkg/tcpip/stack/forwarder_test.go
+++ b/pkg/tcpip/stack/forwarder_test.go
@@ -473,7 +473,7 @@ func TestForwardingWithFakeResolverPartialTimeout(t *testing.T) {
t.Fatal("packet not forwarded")
}
- b := p.Pkt.Header.View()
+ b := p.Pkt.Data.First()
if b[0] != 3 {
t.Fatalf("got b[0] = %d, want = 3", b[0])
}
@@ -517,7 +517,7 @@ func TestForwardingWithFakeResolverTwoPackets(t *testing.T) {
t.Fatal("packet not forwarded")
}
- b := p.Pkt.Header.View()
+ b := p.Pkt.Data.First()
if b[0] != 3 {
t.Fatalf("got b[0] = %d, want = 3", b[0])
}
@@ -564,7 +564,7 @@ func TestForwardingWithFakeResolverManyPackets(t *testing.T) {
t.Fatal("packet not forwarded")
}
- b := p.Pkt.Header.View()
+ b := p.Pkt.Data.First()
if b[0] != 3 {
t.Fatalf("got b[0] = %d, want = 3", b[0])
}
@@ -619,7 +619,7 @@ func TestForwardingWithFakeResolverManyResolutions(t *testing.T) {
// The first 5 packets (address 3 to 7) should not be forwarded
// because their address resolutions are interrupted.
- b := p.Pkt.Header.View()
+ b := p.Pkt.Data.First()
if b[0] < 8 {
t.Fatalf("got b[0] = %d, want b[0] >= 8", b[0])
}