Commit 3582b900 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

6lowpan: cleanup skb copy data

This patch drops the direct memcpy on skb and uses the right skb
memcpy functions. Also remove an unnecessary check if plen is non zero.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Reviewed-by: default avatarWerner Almesberger <werner@almesberger.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 578d5241
......@@ -1122,12 +1122,15 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
frag->priority = skb->priority;
/* copy header, MFR and payload */
memcpy(skb_put(frag, mlen), skb->data, mlen);
memcpy(skb_put(frag, hlen), head, hlen);
skb_put(frag, mlen);
skb_copy_to_linear_data(frag, skb_mac_header(skb), mlen);
if (plen)
skb_copy_from_linear_data_offset(skb, offset + mlen,
skb_put(frag, plen), plen);
skb_put(frag, hlen);
skb_copy_to_linear_data_offset(frag, mlen, head, hlen);
skb_put(frag, plen);
skb_copy_to_linear_data_offset(frag, mlen + hlen,
skb_network_header(skb) + offset, plen);
lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
frag->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment