Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
[linux-2.6-block.git] / net / core / gro.c
index 78110edf5d4b36d2fa6f8a2676096efe0112aa0e..b4190eb084672fb4f2be8b437eccb4e8507ff63f 100644 (file)
@@ -167,6 +167,14 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
        if (unlikely(p->len + len >= gro_max_size || NAPI_GRO_CB(skb)->flush))
                return -E2BIG;
 
+       if (unlikely(p->len + len >= GRO_LEGACY_MAX_SIZE)) {
+               if (p->protocol != htons(ETH_P_IPV6) ||
+                   skb_headroom(p) < sizeof(struct hop_jumbo_hdr) ||
+                   ipv6_hdr(p)->nexthdr != IPPROTO_TCP ||
+                   p->encapsulation)
+                       return -E2BIG;
+       }
+
        lp = NAPI_GRO_CB(p)->last;
        pinfo = skb_shinfo(lp);