Commit b2907e50 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Patrick McHardy

netfilter: xtables: fix mangle tables

In POST_ROUTING hook, calling dev_net(in) is going to oops.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 9d288dff
...@@ -87,7 +87,9 @@ iptable_mangle_hook(unsigned int hook, ...@@ -87,7 +87,9 @@ iptable_mangle_hook(unsigned int hook,
{ {
if (hook == NF_INET_LOCAL_OUT) if (hook == NF_INET_LOCAL_OUT)
return ipt_local_hook(hook, skb, in, out, okfn); return ipt_local_hook(hook, skb, in, out, okfn);
if (hook == NF_INET_POST_ROUTING)
return ipt_do_table(skb, hook, in, out,
dev_net(out)->ipv4.iptable_mangle);
/* PREROUTING/INPUT/FORWARD: */ /* PREROUTING/INPUT/FORWARD: */
return ipt_do_table(skb, hook, in, out, return ipt_do_table(skb, hook, in, out,
dev_net(in)->ipv4.iptable_mangle); dev_net(in)->ipv4.iptable_mangle);
......
...@@ -81,7 +81,9 @@ ip6table_mangle_hook(unsigned int hook, struct sk_buff *skb, ...@@ -81,7 +81,9 @@ ip6table_mangle_hook(unsigned int hook, struct sk_buff *skb,
{ {
if (hook == NF_INET_LOCAL_OUT) if (hook == NF_INET_LOCAL_OUT)
return ip6t_local_out_hook(hook, skb, out, okfn); return ip6t_local_out_hook(hook, skb, out, okfn);
if (hook == NF_INET_POST_ROUTING)
return ip6t_do_table(skb, hook, in, out,
dev_net(out)->ipv6.ip6table_mangle);
/* INPUT/FORWARD */ /* INPUT/FORWARD */
return ip6t_do_table(skb, hook, in, out, return ip6t_do_table(skb, hook, in, out,
dev_net(in)->ipv6.ip6table_mangle); dev_net(in)->ipv6.ip6table_mangle);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment