18
18
#include <net/net_namespace.h>
19
19
#include "smack.h"
20
20
21
- #if IS_ENABLED (CONFIG_IPV6 )
22
-
23
- static unsigned int smack_ipv6_output (void * priv ,
24
- struct sk_buff * skb ,
25
- const struct nf_hook_state * state )
26
- {
27
- struct sock * sk = skb_to_full_sk (skb );
28
- struct socket_smack * ssp ;
29
- struct smack_known * skp ;
30
-
31
- if (sk && sk -> sk_security ) {
32
- ssp = sk -> sk_security ;
33
- skp = ssp -> smk_out ;
34
- skb -> secmark = skp -> smk_secid ;
35
- }
36
-
37
- return NF_ACCEPT ;
38
- }
39
- #endif /* IPV6 */
40
-
41
- static unsigned int smack_ipv4_output (void * priv ,
21
+ static unsigned int smack_ip_output (void * priv ,
42
22
struct sk_buff * skb ,
43
23
const struct nf_hook_state * state )
44
24
{
@@ -57,14 +37,14 @@ static unsigned int smack_ipv4_output(void *priv,
57
37
58
38
static const struct nf_hook_ops smack_nf_ops [] = {
59
39
{
60
- .hook = smack_ipv4_output ,
40
+ .hook = smack_ip_output ,
61
41
.pf = NFPROTO_IPV4 ,
62
42
.hooknum = NF_INET_LOCAL_OUT ,
63
43
.priority = NF_IP_PRI_SELINUX_FIRST ,
64
44
},
65
45
#if IS_ENABLED (CONFIG_IPV6 )
66
46
{
67
- .hook = smack_ipv6_output ,
47
+ .hook = smack_ip_output ,
68
48
.pf = NFPROTO_IPV6 ,
69
49
.hooknum = NF_INET_LOCAL_OUT ,
70
50
.priority = NF_IP6_PRI_SELINUX_FIRST ,
0 commit comments