Debian Codegraph @

runtime/linux/autoconf-netfilter-4_4.c

raw
1 #include <linux/netfilter.h>
2
3 // The following kernel commit first appears in v4.4-rc1 and replaces
4 // the 'ops' paramter to netfilter function with 'priv':
5 //
6 // commit 06198b34a3e09e06d9aecaa3727e0d37206cea77
7 // Author: Eric W. Biederman <[email protected]>
8 // Date: Fri Sep 18 14:33:06 2015 -0500
9 //
10 // netfilter: Pass priv instead of nf_hook_ops to netfilter hooks
11 //
12 // Only pass the void *priv parameter out of the nf_hook_ops. That is
13 // all any of the functions are interested now, and by limiting what is
14 // passed it becomes simpler to change implementation details.
15 //
16 // The following kernel commit first appears in v4.4-rc1 and removes
17 // the 'owner' field from the nf_hook_ops structure.
18 //
19 // commit 2ffbceb2b08f8ca0496c54a9ebcd11d25275954e
20 // Author: Florian Westphal <[email protected]>
21 // Date: Tue Oct 13 14:33:26 2015 +0200
22 //
23 // netfilter: remove hook owner refcounting
24 //
25 // since commit 8405a8fff3f8 ("netfilter: nf_qeueue: Drop queue entries on
26 // nf_unregister_hook") all pending queued entries are discarded.
27 //
28 // So we can simply remove all of the owner handling -- when module is
29 // removed it also needs to unregister all its hooks.
30
31 unsigned int even_newer_style_hook(void *priv,
32 struct sk_buff *skb,
33 const struct nf_hook_state *state);
34
35 unsigned int even_newer_style_hook(void *priv,
36 struct sk_buff *skb,
37 const struct nf_hook_state *state)
38 {
39 (void) priv; (void) skb; (void) state;
40 return 0;
41 }
42
43 struct nf_hook_ops netfilter_ops = {
44 .hook = even_newer_style_hook
45 };