From 6ba37d1967b454a94bdd87c4e7e2f6d408cb4724 Mon Sep 17 00:00:00 2001 From: Brandon Carpenter Date: Wed, 5 Mar 2014 11:06:07 -0800 Subject: [PATCH] Updated netfilter hooks for kernel version 3.13. --- src/packet_notify.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/packet_notify.c b/src/packet_notify.c index 0ad6939..c2036cd 100644 --- a/src/packet_notify.c +++ b/src/packet_notify.c @@ -75,7 +75,13 @@ static int fault_handler(struct kprobe *p, struct pt_regs *regs, int trapnr) return 0; } -static unsigned int nf_hook_v4_in(unsigned int hook, struct sk_buff *skb, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) +typedef const struct nf_hook_ops * nf_hook_type; +#else +typedef unsigned int nf_hook_type; +#endif + +static unsigned int nf_hook_v4_in(nf_hook_type hook, struct sk_buff *skb, const struct net_device *indev, const struct net_device *outdev, int (*okfn)(struct sk_buff *)) { @@ -88,7 +94,7 @@ static unsigned int nf_hook_v4_in(unsigned int hook, struct sk_buff *skb, } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -static unsigned int nf_hook_v6_in(unsigned int hook, struct sk_buff *skb, +static unsigned int nf_hook_v6_in(nf_hook_type hook, struct sk_buff *skb, const struct net_device *indev, const struct net_device *outdev, int (*okfn)(struct sk_buff *)) { @@ -101,7 +107,7 @@ static unsigned int nf_hook_v6_in(unsigned int hook, struct sk_buff *skb, } #endif -static unsigned int nf_hook_out(unsigned int hook, struct sk_buff *skb, +static unsigned int nf_hook_out(nf_hook_type hook, struct sk_buff *skb, const struct net_device *indev, const struct net_device *outdev, int (*okfn)(struct sk_buff *))