[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
@@ -807,10 +807,10 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
txbuf[4] = 0x00;
|
||||
txbuf[5] = 0x00;
|
||||
|
||||
memcpy(txbuf+6, skb->data+12, skb->len-12);
|
||||
skb_copy_from_linear_data_offset(skb, 12, txbuf + 6, skb->len - 12);
|
||||
if (pad)
|
||||
txbuf[skb->len-12+6]=0;
|
||||
memcpy(txbuf+skb->len-12+6+pad, skb->data, 12);
|
||||
skb_copy_from_linear_data(skb, txbuf + skb->len - 12 + 6 + pad, 12);
|
||||
*(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6);
|
||||
txbuf[txbuflen-1] = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user