net: ipv6: send pkttoobig immediately if orig frag size > mtu
[firefly-linux-kernel-4.4.55.git] / net / ipv6 / udp_offload.c
index d3cfaf9c7a0858d8bb1e9fd60c412c3b03cbf3e3..2f65b022627b90481a7738b16c82bf770ed300c8 100644 (file)
@@ -85,7 +85,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
 
        /* Check if there is enough headroom to insert fragment header. */
        tnl_hlen = skb_tnl_header_len(skb);
-       if (skb_headroom(skb) < (tnl_hlen + frag_hdr_sz)) {
+       if (skb_mac_header(skb) < skb->head + tnl_hlen + frag_hdr_sz) {
                if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz))
                        goto out;
        }
@@ -108,7 +108,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
        fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen);
        fptr->nexthdr = nexthdr;
        fptr->reserved = 0;
-       ipv6_select_ident(fptr, (struct rt6_info *)skb_dst(skb));
+       fptr->identification = skb_shinfo(skb)->ip6_frag_id;
 
        /* Fragment the skb. ipv6 header and the remaining fields of the
         * fragment header are updated in ipv6_gso_segment()