Browse Source

Merge pull request #2 from svenpaulsen/patch-2

Fix "implicit declaration of function ‘skb_put_padto’" build issues
pull/6/head
nwerensteijn 8 years ago committed by GitHub
parent
commit
01b919f4d3
  1. 15
      src/compat_skbuff.h

15
src/compat_skbuff.h

@ -20,4 +20,19 @@ struct udphdr; @@ -20,4 +20,19 @@ struct udphdr;
# define skb_secmark(skb) 0
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
static inline int skb_put_padto(struct sk_buff *skb, unsigned int len)
{
unsigned int size = skb->len;
if (unlikely(size < len)) {
len -= size;
if (skb_pad(skb, len)) return -ENOMEM;
__skb_put(skb, len);
}
return 0;
}
#endif
#endif /* COMPAT_SKBUFF_H */

Loading…
Cancel
Save