diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-05 00:32:35 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-05 00:32:35 +0000 |
commit | d2dee4e92825f5a68c3a7b1f00fb07471e428617 (patch) | |
tree | 03798cf91d4c80ef989ca5ea8e64b3467056ade4 /pkg/tcpip/network/ipv4 | |
parent | 100d8f4e88bfda450339ded775d34e5a24ad9354 (diff) | |
parent | b29aeebaf6bb646dcb67e55b9930902975281685 (diff) |
Merge release-20200127.0-79-gb29aeeb (automated)
Diffstat (limited to 'pkg/tcpip/network/ipv4')
-rw-r--r-- | pkg/tcpip/network/ipv4/ipv4.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/tcpip/network/ipv4/ipv4.go b/pkg/tcpip/network/ipv4/ipv4.go index 85512f9b2..6597e6781 100644 --- a/pkg/tcpip/network/ipv4/ipv4.go +++ b/pkg/tcpip/network/ipv4/ipv4.go @@ -353,6 +353,11 @@ func (e *endpoint) HandlePacket(r *stack.Route, pkt tcpip.PacketBuffer) { } pkt.NetworkHeader = headerView[:h.HeaderLength()] + hlen := int(h.HeaderLength()) + tlen := int(h.TotalLength()) + pkt.Data.TrimFront(hlen) + pkt.Data.CapLength(tlen - hlen) + // iptables filtering. All packets that reach here are intended for // this machine and will not be forwarded. ipt := e.stack.IPTables() @@ -361,11 +366,6 @@ func (e *endpoint) HandlePacket(r *stack.Route, pkt tcpip.PacketBuffer) { return } - hlen := int(h.HeaderLength()) - tlen := int(h.TotalLength()) - pkt.Data.TrimFront(hlen) - pkt.Data.CapLength(tlen - hlen) - more := (h.Flags() & header.IPv4FlagMoreFragments) != 0 if more || h.FragmentOffset() != 0 { if pkt.Data.Size() == 0 { |