[SK_BUFF]: Introduce skb_set_mac_header()
For the cases where we want to set skb->mac.raw to an offset from skb->data. Simple cases first, the memmove ones and specially pktgen will be left for later. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
f64955eb11
commit
48d49d0ccd
@@ -965,6 +965,11 @@ static inline void skb_reset_mac_header(struct sk_buff *skb)
|
||||
skb->mac.raw = skb->data;
|
||||
}
|
||||
|
||||
static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
|
||||
{
|
||||
skb->mac.raw = skb->data + offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* CPUs often take a performance hit when accessing unaligned memory
|
||||
* locations. The actual performance hit varies, it can be small if the
|
||||
|
Reference in New Issue
Block a user