diff options
author | David S. Miller <davem@davemloft.net> | 2015-04-03 20:32:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-04 12:31:38 -0400 |
commit | 238e54c9cb9385a1ba99e92801f3615a2fb398b6 (patch) | |
tree | 4efeb9b5c92f87028a6d321c7088b9d1e270360a /security | |
parent | 1d1de89b9a4746f1dd055a3b8d073dd2f962a3b6 (diff) |
netfilter: Make nf_hookfn use nf_hook_state.
Pass the nf_hook_state all the way down into the hook
functions themselves.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 28 | ||||
-rw-r--r-- | security/smack/smack_netfilter.c | 8 |
2 files changed, 11 insertions, 25 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index edc66de39f2e..7e392edaab97 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -4852,21 +4852,17 @@ static unsigned int selinux_ip_forward(struct sk_buff *skb, | |||
4852 | 4852 | ||
4853 | static unsigned int selinux_ipv4_forward(const struct nf_hook_ops *ops, | 4853 | static unsigned int selinux_ipv4_forward(const struct nf_hook_ops *ops, |
4854 | struct sk_buff *skb, | 4854 | struct sk_buff *skb, |
4855 | const struct net_device *in, | 4855 | const struct nf_hook_state *state) |
4856 | const struct net_device *out, | ||
4857 | int (*okfn)(struct sk_buff *)) | ||
4858 | { | 4856 | { |
4859 | return selinux_ip_forward(skb, in, PF_INET); | 4857 | return selinux_ip_forward(skb, state->in, PF_INET); |
4860 | } | 4858 | } |
4861 | 4859 | ||
4862 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 4860 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
4863 | static unsigned int selinux_ipv6_forward(const struct nf_hook_ops *ops, | 4861 | static unsigned int selinux_ipv6_forward(const struct nf_hook_ops *ops, |
4864 | struct sk_buff *skb, | 4862 | struct sk_buff *skb, |
4865 | const struct net_device *in, | 4863 | const struct nf_hook_state *state) |
4866 | const struct net_device *out, | ||
4867 | int (*okfn)(struct sk_buff *)) | ||
4868 | { | 4864 | { |
4869 | return selinux_ip_forward(skb, in, PF_INET6); | 4865 | return selinux_ip_forward(skb, state->in, PF_INET6); |
4870 | } | 4866 | } |
4871 | #endif /* IPV6 */ | 4867 | #endif /* IPV6 */ |
4872 | 4868 | ||
@@ -4914,9 +4910,7 @@ static unsigned int selinux_ip_output(struct sk_buff *skb, | |||
4914 | 4910 | ||
4915 | static unsigned int selinux_ipv4_output(const struct nf_hook_ops *ops, | 4911 | static unsigned int selinux_ipv4_output(const struct nf_hook_ops *ops, |
4916 | struct sk_buff *skb, | 4912 | struct sk_buff *skb, |
4917 | const struct net_device *in, | 4913 | const struct nf_hook_state *state) |
4918 | const struct net_device *out, | ||
4919 | int (*okfn)(struct sk_buff *)) | ||
4920 | { | 4914 | { |
4921 | return selinux_ip_output(skb, PF_INET); | 4915 | return selinux_ip_output(skb, PF_INET); |
4922 | } | 4916 | } |
@@ -5091,21 +5085,17 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, | |||
5091 | 5085 | ||
5092 | static unsigned int selinux_ipv4_postroute(const struct nf_hook_ops *ops, | 5086 | static unsigned int selinux_ipv4_postroute(const struct nf_hook_ops *ops, |
5093 | struct sk_buff *skb, | 5087 | struct sk_buff *skb, |
5094 | const struct net_device *in, | 5088 | const struct nf_hook_state *state) |
5095 | const struct net_device *out, | ||
5096 | int (*okfn)(struct sk_buff *)) | ||
5097 | { | 5089 | { |
5098 | return selinux_ip_postroute(skb, out, PF_INET); | 5090 | return selinux_ip_postroute(skb, state->out, PF_INET); |
5099 | } | 5091 | } |
5100 | 5092 | ||
5101 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 5093 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
5102 | static unsigned int selinux_ipv6_postroute(const struct nf_hook_ops *ops, | 5094 | static unsigned int selinux_ipv6_postroute(const struct nf_hook_ops *ops, |
5103 | struct sk_buff *skb, | 5095 | struct sk_buff *skb, |
5104 | const struct net_device *in, | 5096 | const struct nf_hook_state *state) |
5105 | const struct net_device *out, | ||
5106 | int (*okfn)(struct sk_buff *)) | ||
5107 | { | 5097 | { |
5108 | return selinux_ip_postroute(skb, out, PF_INET6); | 5098 | return selinux_ip_postroute(skb, state->out, PF_INET6); |
5109 | } | 5099 | } |
5110 | #endif /* IPV6 */ | 5100 | #endif /* IPV6 */ |
5111 | 5101 | ||
diff --git a/security/smack/smack_netfilter.c b/security/smack/smack_netfilter.c index c952632afb0d..a455cfc9ec1f 100644 --- a/security/smack/smack_netfilter.c +++ b/security/smack/smack_netfilter.c | |||
@@ -23,9 +23,7 @@ | |||
23 | 23 | ||
24 | static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, | 24 | static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, |
25 | struct sk_buff *skb, | 25 | struct sk_buff *skb, |
26 | const struct net_device *in, | 26 | const struct nf_hook_state *state) |
27 | const struct net_device *out, | ||
28 | int (*okfn)(struct sk_buff *)) | ||
29 | { | 27 | { |
30 | struct socket_smack *ssp; | 28 | struct socket_smack *ssp; |
31 | struct smack_known *skp; | 29 | struct smack_known *skp; |
@@ -42,9 +40,7 @@ static unsigned int smack_ipv6_output(const struct nf_hook_ops *ops, | |||
42 | 40 | ||
43 | static unsigned int smack_ipv4_output(const struct nf_hook_ops *ops, | 41 | static unsigned int smack_ipv4_output(const struct nf_hook_ops *ops, |
44 | struct sk_buff *skb, | 42 | struct sk_buff *skb, |
45 | const struct net_device *in, | 43 | const struct nf_hook_state *state) |
46 | const struct net_device *out, | ||
47 | int (*okfn)(struct sk_buff *)) | ||
48 | { | 44 | { |
49 | struct socket_smack *ssp; | 45 | struct socket_smack *ssp; |
50 | struct smack_known *skp; | 46 | struct smack_known *skp; |