index2 = get_ncm(&tmp, opts->dgram_item_len);
dg_len2 = get_ncm(&tmp, opts->dgram_item_len);
- skb2 = skb_clone(skb, GFP_ATOMIC);
+ /*
+ * Copy the data into a new skb.
+ * This ensures the truesize is correct
+ */
+ skb2 = netdev_alloc_skb_ip_align(ncm->netdev,
+ dg_len - crc_len);
if (skb2 == NULL)
goto err;
+ memcpy(skb_put(skb2, dg_len - crc_len),
+ skb->data + index, dg_len - crc_len);
- if (!skb_pull(skb2, index)) {
- ret = -EOVERFLOW;
- goto err;
- }
-
- skb_trim(skb2, dg_len - crc_len);
skb_queue_tail(list, skb2);
ndp_len -= 2 * (opts->dgram_item_len * 2);