diff options
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0bb6b6de7962..8fa83b78f81a 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -128,16 +128,8 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff * | |||
128 | return -EINVAL; | 128 | return -EINVAL; |
129 | } | 129 | } |
130 | 130 | ||
131 | static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb) | 131 | static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb) |
132 | { | 132 | { |
133 | int ret; | ||
134 | |||
135 | ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb); | ||
136 | if (ret) { | ||
137 | kfree_skb(skb); | ||
138 | return ret; | ||
139 | } | ||
140 | |||
141 | #if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM) | 133 | #if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM) |
142 | /* Policy lookup after SNAT yielded a new policy */ | 134 | /* Policy lookup after SNAT yielded a new policy */ |
143 | if (skb_dst(skb)->xfrm) { | 135 | if (skb_dst(skb)->xfrm) { |
@@ -154,6 +146,22 @@ static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *s | |||
154 | return ip6_finish_output2(net, sk, skb); | 146 | return ip6_finish_output2(net, sk, skb); |
155 | } | 147 | } |
156 | 148 | ||
149 | static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb) | ||
150 | { | ||
151 | int ret; | ||
152 | |||
153 | ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb); | ||
154 | switch (ret) { | ||
155 | case NET_XMIT_SUCCESS: | ||
156 | return __ip6_finish_output(net, sk, skb); | ||
157 | case NET_XMIT_CN: | ||
158 | return __ip6_finish_output(net, sk, skb) ? : ret; | ||
159 | default: | ||
160 | kfree_skb(skb); | ||
161 | return ret; | ||
162 | } | ||
163 | } | ||
164 | |||
157 | int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb) | 165 | int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb) |
158 | { | 166 | { |
159 | struct net_device *dev = skb_dst(skb)->dev; | 167 | struct net_device *dev = skb_dst(skb)->dev; |