aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-02-21 22:07:11 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-21 22:07:11 -0500
commit9c572dc4835aaca7a2f81db184dc25833980bb9c (patch)
tree78c48c223c2b45253361e929a1bffc291dd16925 /include/linux/skbuff.h
parentMerge branch 'geneve-vxlan-outer-checksum' (diff)
parentbpf: don't emit mov A,A on return (diff)
downloadwireguard-linux-9c572dc4835aaca7a2f81db184dc25833980bb9c.tar.xz
wireguard-linux-9c572dc4835aaca7a2f81db184dc25833980bb9c.zip
Merge branch 'bpf-helper-improvements'
Daniel Borkmann says: ==================== BPF updates This set contains various updates for eBPF, i.e. the addition of a generic csum helper function and other misc bits that mostly improve existing helpers and ease programming with eBPF on cls_bpf. For more details, please see individual patches. Set is rebased on top of http://patchwork.ozlabs.org/patch/584465/. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 89b536796e53..6a57757a86cf 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2630,6 +2630,13 @@ static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len
skb_headroom(skb) + len <= skb->hdr_len;
}
+static inline int skb_try_make_writable(struct sk_buff *skb,
+ unsigned int write_len)
+{
+ return skb_cloned(skb) && !skb_clone_writable(skb, write_len) &&
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
+}
+
static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom,
int cloned)
{