aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/iptable_mangle.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-10-11 17:15:10 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-10-14 23:06:53 +0200
commit8844e01062ddd8196c4550df9803cc1835d123c2 (patch)
tree50693cedc8ee91b69c9e956563351923852b6924 /net/ipv4/netfilter/iptable_mangle.c
parentaf_packet: Introduce egress hook (diff)
downloadlinux-dev-8844e01062ddd8196c4550df9803cc1835d123c2.tar.xz
linux-dev-8844e01062ddd8196c4550df9803cc1835d123c2.zip
netfilter: iptables: allow use of ipt_do_table as hookfn
This is possible now that the xt_table structure is passed in via *priv. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter/iptable_mangle.c')
-rw-r--r--net/ipv4/netfilter/iptable_mangle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index 40417a3f930b..3abb430af9e6 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -34,7 +34,7 @@ static const struct xt_table packet_mangler = {
};
static unsigned int
-ipt_mangle_out(struct sk_buff *skb, const struct nf_hook_state *state, void *priv)
+ipt_mangle_out(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)
{
unsigned int ret;
const struct iphdr *iph;
@@ -50,7 +50,7 @@ ipt_mangle_out(struct sk_buff *skb, const struct nf_hook_state *state, void *pri
daddr = iph->daddr;
tos = iph->tos;
- ret = ipt_do_table(skb, state, priv);
+ ret = ipt_do_table(priv, skb, state);
/* Reroute for ANY change. */
if (ret != NF_DROP && ret != NF_STOLEN) {
iph = ip_hdr(skb);
@@ -75,8 +75,8 @@ iptable_mangle_hook(void *priv,
const struct nf_hook_state *state)
{
if (state->hook == NF_INET_LOCAL_OUT)
- return ipt_mangle_out(skb, state, priv);
- return ipt_do_table(skb, state, priv);
+ return ipt_mangle_out(priv, skb, state);
+ return ipt_do_table(priv, skb, state);
}
static struct nf_hook_ops *mangle_ops __read_mostly;