aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-10-30 04:18:24 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-30 17:18:46 -0400
commit3582b900ad2c1e218e4963060ba6dcf757cb702e (patch)
tree6483821dfea97939caae9b0136884a12d2bd39f7 /net/ieee802154
parent578d524127612354d91905f932ee88d73d8d1645 (diff)
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: Alexander Aring <alex.aring@gmail.com> Reviewed-by: Werner Almesberger <werner@almesberger.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/6lowpan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 58c07fd967d1..9497c6f3276b 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1122,12 +1122,15 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
1122 frag->priority = skb->priority; 1122 frag->priority = skb->priority;
1123 1123
1124 /* copy header, MFR and payload */ 1124 /* copy header, MFR and payload */
1125 memcpy(skb_put(frag, mlen), skb->data, mlen); 1125 skb_put(frag, mlen);
1126 memcpy(skb_put(frag, hlen), head, hlen); 1126 skb_copy_to_linear_data(frag, skb_mac_header(skb), mlen);
1127 1127
1128 if (plen) 1128 skb_put(frag, hlen);
1129 skb_copy_from_linear_data_offset(skb, offset + mlen, 1129 skb_copy_to_linear_data_offset(frag, mlen, head, hlen);
1130 skb_put(frag, plen), plen); 1130
1131 skb_put(frag, plen);
1132 skb_copy_to_linear_data_offset(frag, mlen + hlen,
1133 skb_network_header(skb) + offset, plen);
1131 1134
1132 lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data, 1135 lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
1133 frag->len); 1136 frag->len);