[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>
This commit is contained in:

committed by
David S. Miller

parent
2a123b86e2
commit
d626f62b11
@@ -2242,7 +2242,8 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned i
|
||||
rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len);
|
||||
/* Get source address */
|
||||
#ifdef WIRELESS_SPY
|
||||
memcpy(linksrcaddr, ((struct mac_header *)skb->data)->addr_2, ETH_ALEN);
|
||||
skb_copy_from_linear_data_offset(skb, offsetof(struct mac_header, addr_2),
|
||||
linksrcaddr, ETH_ALEN);
|
||||
#endif
|
||||
/* Now, deal with encapsulation/translation/sniffer */
|
||||
if (!sniffer) {
|
||||
|
Reference in New Issue
Block a user