Skip to content

Commit 6ba37d1

Browse files
author
Brandon Carpenter
committed
Updated netfilter hooks for kernel version 3.13.
1 parent 69fbab8 commit 6ba37d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/packet_notify.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ static int fault_handler(struct kprobe *p, struct pt_regs *regs, int trapnr)
7575
return 0;
7676
}
7777

78-
static unsigned int nf_hook_v4_in(unsigned int hook, struct sk_buff *skb,
78+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
79+
typedef const struct nf_hook_ops * nf_hook_type;
80+
#else
81+
typedef unsigned int nf_hook_type;
82+
#endif
83+
84+
static unsigned int nf_hook_v4_in(nf_hook_type hook, struct sk_buff *skb,
7985
const struct net_device *indev, const struct net_device *outdev,
8086
int (*okfn)(struct sk_buff *))
8187
{
@@ -88,7 +94,7 @@ static unsigned int nf_hook_v4_in(unsigned int hook, struct sk_buff *skb,
8894
}
8995

9096
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
91-
static unsigned int nf_hook_v6_in(unsigned int hook, struct sk_buff *skb,
97+
static unsigned int nf_hook_v6_in(nf_hook_type hook, struct sk_buff *skb,
9298
const struct net_device *indev, const struct net_device *outdev,
9399
int (*okfn)(struct sk_buff *))
94100
{
@@ -101,7 +107,7 @@ static unsigned int nf_hook_v6_in(unsigned int hook, struct sk_buff *skb,
101107
}
102108
#endif
103109

104-
static unsigned int nf_hook_out(unsigned int hook, struct sk_buff *skb,
110+
static unsigned int nf_hook_out(nf_hook_type hook, struct sk_buff *skb,
105111
const struct net_device *indev,
106112
const struct net_device *outdev,
107113
int (*okfn)(struct sk_buff *))

0 commit comments

Comments
 (0)