summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/ipv6/ipv6.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-24 00:33:56 +0000
committergVisor bot <gvisor-bot@google.com>2020-04-24 00:33:56 +0000
commitc860716ef867306f28feccf25ab9c0066e3c5ffb (patch)
tree02ef0516b5fea1e5be8723d1c1999aa22f145282 /pkg/tcpip/network/ipv6/ipv6.go
parent4b90fa57811fd8ad60e10cfe8fa0fca9edb7522c (diff)
parenteccae0f77d3708d591119488f427eca90de7c711 (diff)
Merge release-20200323.0-227-geccae0f (automated)
Diffstat (limited to 'pkg/tcpip/network/ipv6/ipv6.go')
-rw-r--r--pkg/tcpip/network/ipv6/ipv6.go6
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()