File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #ifndef LINUX_VERSION_CODE
2+ #include <linux/version.h>
3+ #endif
14#include <linux/module.h>
25#include <linux/kernel.h>
36#include <net/ip.h>
@@ -10,6 +13,12 @@ MODULE_AUTHOR("Semyon Verchenko");
1013MODULE_DESCRIPTION ("Netfilter module to set/reset DF flag" );
1114MODULE_LICENSE ("Dual BSD/GPL" );
1215
16+ #if (LINUX_VERSION_CODE < KERNEL_VERSION (5 ,2 ,0 ))
17+ # skb_make_writable was removed in this commit:
18+ # https ://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=2cf6bffc49dae26edd12af6b57c8c780590380bf
19+ #define skb_ensure_writable (skb , len ) (!skb_make_writable((skb), (len)))
20+ #endif
21+
1322static int df_tg_check (const struct xt_tgchk_param * param )
1423{
1524 return 0 ;
@@ -23,7 +32,7 @@ static unsigned int df_tg(struct sk_buff *skb, const struct xt_action_param *par
2332 __u16 old_frag_off , new_frag_off ;
2433
2534 /* make_writable might invoke copy-on-write, so fetch iph afterwards */
26- if (! skb_make_writable (skb , sizeof (struct iphdr ))){
35+ if (skb_ensure_writable (skb , sizeof (struct iphdr ))){
2736 printk (KERN_ERR "DF: Error making skb writable\n" );
2837 return NF_DROP ;
2938 }
You can’t perform that action at this time.
0 commit comments