Skip to content

Commit

Permalink
Updated netfilter hooks for kernel version 3.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Carpenter committed Mar 5, 2014
1 parent 69fbab8 commit 6ba37d1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/packet_notify.c
Expand Up @@ -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 *))
{
Expand All @@ -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 *))
{
Expand All @@ -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 *))
Expand Down

0 comments on commit 6ba37d1

Please sign in to comment.