diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:23 -0400 |
commit | d626f62b11e00c16e81e4308ab93d3f13551812a (patch) | |
tree | fac4af6ced853755e12fc709d55f0c2bec51265d /net/ieee80211 | |
parent | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (diff) |
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_wep.c | 2 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 6 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_tx.c | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index ec6d8851a061..4eb35079e434 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
@@ -152,7 +152,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
152 | return -1; | 152 | return -1; |
153 | 153 | ||
154 | /* Copy the IV into the first 3 bytes of the key */ | 154 | /* Copy the IV into the first 3 bytes of the key */ |
155 | memcpy(key, skb->data + hdr_len, 3); | 155 | skb_copy_from_linear_data_offset(skb, hdr_len, key, 3); |
156 | 156 | ||
157 | /* Copy rest of the WEP key (the secret part) */ | 157 | /* Copy rest of the WEP key (the secret part) */ |
158 | memcpy(key + 3, wep->key, wep->key_len); | 158 | memcpy(key + 3, wep->key, wep->key_len); |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 59a765c49cf9..94e2b8e2ab26 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -606,12 +606,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
606 | if (frag == 0) { | 606 | if (frag == 0) { |
607 | /* copy first fragment (including full headers) into | 607 | /* copy first fragment (including full headers) into |
608 | * beginning of the fragment cache skb */ | 608 | * beginning of the fragment cache skb */ |
609 | memcpy(skb_put(frag_skb, flen), skb->data, flen); | 609 | skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), flen); |
610 | } else { | 610 | } else { |
611 | /* append frame payload to the end of the fragment | 611 | /* append frame payload to the end of the fragment |
612 | * cache skb */ | 612 | * cache skb */ |
613 | memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, | 613 | skb_copy_from_linear_data_offset(skb, hdrlen, |
614 | flen); | 614 | skb_put(frag_skb, flen), flen); |
615 | } | 615 | } |
616 | dev_kfree_skb_any(skb); | 616 | dev_kfree_skb_any(skb); |
617 | skb = NULL; | 617 | skb = NULL; |
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 62a8a2b76539..a4c3c51140a3 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -309,8 +309,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | /* Save source and destination addresses */ | 311 | /* Save source and destination addresses */ |
312 | memcpy(dest, skb->data, ETH_ALEN); | 312 | skb_copy_from_linear_data(skb, dest, ETH_ALEN); |
313 | memcpy(src, skb->data + ETH_ALEN, ETH_ALEN); | 313 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, src, ETH_ALEN); |
314 | 314 | ||
315 | if (host_encrypt || host_build_iv) | 315 | if (host_encrypt || host_build_iv) |
316 | fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | | 316 | fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | |
@@ -363,7 +363,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
363 | snapped = 1; | 363 | snapped = 1; |
364 | ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)), | 364 | ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)), |
365 | ether_type); | 365 | ether_type); |
366 | memcpy(skb_put(skb_new, skb->len), skb->data, skb->len); | 366 | skb_copy_from_linear_data(skb, skb_put(skb_new, skb->len), skb->len); |
367 | res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv); | 367 | res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv); |
368 | if (res < 0) { | 368 | if (res < 0) { |
369 | IEEE80211_ERROR("msdu encryption failed\n"); | 369 | IEEE80211_ERROR("msdu encryption failed\n"); |
@@ -492,7 +492,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
492 | bytes -= SNAP_SIZE + sizeof(u16); | 492 | bytes -= SNAP_SIZE + sizeof(u16); |
493 | } | 493 | } |
494 | 494 | ||
495 | memcpy(skb_put(skb_frag, bytes), skb->data, bytes); | 495 | skb_copy_from_linear_data(skb, skb_put(skb_frag, bytes), bytes); |
496 | 496 | ||
497 | /* Advance the SKB... */ | 497 | /* Advance the SKB... */ |
498 | skb_pull(skb, bytes); | 498 | skb_pull(skb, bytes); |