summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/ipv6/ipv6.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-05-01 16:08:26 -0700
committergVisor bot <gvisor-bot@google.com>2020-05-01 16:09:53 -0700
commit5e1e61fbcbe8fa3cc8b104fadb8cdef3ad29c31f (patch)
treedff4d88c41b32c8b2973ba0006d22c172c83e278 /pkg/tcpip/network/ipv6/ipv6.go
parente7b8a71156b53f835c8d5ea01bdb1859e740649d (diff)
Automated rollback of changelist 308674219
PiperOrigin-RevId: 309491861
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 82928fb66..daf1fcbc6 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()