[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:
parent
2a123b86e2
commit
d626f62b11
133 changed files with 321 additions and 230 deletions
|
|
@ -1507,6 +1507,20 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
|
||||
void *to,
|
||||
const unsigned int len)
|
||||
{
|
||||
memcpy(to, skb->data, len);
|
||||
}
|
||||
|
||||
static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
|
||||
const int offset, void *to,
|
||||
const unsigned int len)
|
||||
{
|
||||
memcpy(to, skb->data + offset, len);
|
||||
}
|
||||
|
||||
extern void skb_init(void);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue