diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-20 21:36:32 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-20 21:36:32 +0000 |
commit | f136200c92da0431128db9f816be2bb0fe7382cc (patch) | |
tree | 59b869b51650e7963afc7d031961bbdd4ec36609 /pkg/tcpip/network/ipv6/ipv6.go | |
parent | b982db8fdc6b69c08d3c5a21ae0b2994240fa947 (diff) | |
parent | 07b1b4cc98552a7d45d673ce1e4d1222bbffca7d (diff) |
Merge release-20200323.0-195-g07b1b4c (automated)
Diffstat (limited to 'pkg/tcpip/network/ipv6/ipv6.go')
-rw-r--r-- | pkg/tcpip/network/ipv6/ipv6.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/tcpip/network/ipv6/ipv6.go b/pkg/tcpip/network/ipv6/ipv6.go index 331b0817b..486725131 100644 --- a/pkg/tcpip/network/ipv6/ipv6.go +++ b/pkg/tcpip/network/ipv6/ipv6.go @@ -171,7 +171,11 @@ func (*endpoint) WriteHeaderIncludedPacket(r *stack.Route, pkt stack.PacketBuffe // HandlePacket is called by the link layer when new ipv6 packets arrive for // this endpoint. func (e *endpoint) HandlePacket(r *stack.Route, pkt stack.PacketBuffer) { - headerView := pkt.Data.First() + headerView, ok := pkt.Data.PullUp(header.IPv6MinimumSize) + if !ok { + r.Stats().IP.MalformedPacketsReceived.Increment() + return + } h := header.IPv6(headerView) if !h.IsValid(pkt.Data.Size()) { r.Stats().IP.MalformedPacketsReceived.Increment() |