aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/iptable_mangle.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-03 20:56:08 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-04 12:47:04 -0400
commit1c491ba2592f621f21a693d43fab06302527fc0f (patch)
treec9bf845770ddced5275bb7f367633ecbbc7b2c03 /net/ipv4/netfilter/iptable_mangle.c
parentd7cf4081ed454dba02cb632e492ecf5e29d1ee44 (diff)
downloadlinux-1c491ba2592f621f21a693d43fab06302527fc0f.tar.gz
netfilter: Pass nf_hook_state through ipt_do_table().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter/iptable_mangle.c')
-rw-r--r--net/ipv4/netfilter/iptable_mangle.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index 7a825e7400459..62cbb8c5f4a8f 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -37,8 +37,9 @@ static const struct xt_table packet_mangler = {
};
static unsigned int
-ipt_mangle_out(struct sk_buff *skb, const struct net_device *out)
+ipt_mangle_out(struct sk_buff *skb, const struct nf_hook_state *state)
{
+ struct net_device *out = state->out;
unsigned int ret;
const struct iphdr *iph;
u_int8_t tos;
@@ -58,7 +59,7 @@ ipt_mangle_out(struct sk_buff *skb, const struct net_device *out)
daddr = iph->daddr;
tos = iph->tos;
- ret = ipt_do_table(skb, NF_INET_LOCAL_OUT, NULL, out,
+ ret = ipt_do_table(skb, NF_INET_LOCAL_OUT, state,
dev_net(out)->ipv4.iptable_mangle);
/* Reroute for ANY change. */
if (ret != NF_DROP && ret != NF_STOLEN) {
@@ -84,12 +85,12 @@ iptable_mangle_hook(const struct nf_hook_ops *ops,
const struct nf_hook_state *state)
{
if (ops->hooknum == NF_INET_LOCAL_OUT)
- return ipt_mangle_out(skb, state->out);
+ return ipt_mangle_out(skb, state);
if (ops->hooknum == NF_INET_POST_ROUTING)
- return ipt_do_table(skb, ops->hooknum, state->in, state->out,
+ return ipt_do_table(skb, ops->hooknum, state,
dev_net(state->out)->ipv4.iptable_mangle);
/* PREROUTING/INPUT/FORWARD: */
- return ipt_do_table(skb, ops->hooknum, state->in, state->out,
+ return ipt_do_table(skb, ops->hooknum, state,
dev_net(state->in)->ipv4.iptable_mangle);
}