]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/iptable_mangle.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[karo-tx-linux.git] / net / ipv4 / netfilter / iptable_mangle.c
index 58d7097baa3dab5d236178d9182ec35b80645d12..294a2a32f29345e1ceb39f13afbcc605e586bc4f 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
+#include <linux/slab.h>
 #include <net/sock.h>
 #include <net/route.h>
 #include <linux/ip.h>
@@ -36,11 +37,7 @@ static const struct xt_table packet_mangler = {
 };
 
 static unsigned int
-ipt_local_hook(unsigned int hook,
-                  struct sk_buff *skb,
-                  const struct net_device *in,
-                  const struct net_device *out,
-                  int (*okfn)(struct sk_buff *))
+ipt_mangle_out(struct sk_buff *skb, const struct net_device *out)
 {
        unsigned int ret;
        const struct iphdr *iph;
@@ -60,7 +57,7 @@ ipt_local_hook(unsigned int hook,
        daddr = iph->daddr;
        tos = iph->tos;
 
-       ret = ipt_do_table(skb, hook, in, out,
+       ret = ipt_do_table(skb, NF_INET_LOCAL_OUT, NULL, out,
                           dev_net(out)->ipv4.iptable_mangle);
        /* Reroute for ANY change. */
        if (ret != NF_DROP && ret != NF_STOLEN && ret != NF_QUEUE) {
@@ -86,8 +83,10 @@ iptable_mangle_hook(unsigned int hook,
                     int (*okfn)(struct sk_buff *))
 {
        if (hook == NF_INET_LOCAL_OUT)
-               return ipt_local_hook(hook, skb, in, out, okfn);
-
+               return ipt_mangle_out(skb, out);
+       if (hook == NF_INET_POST_ROUTING)
+               return ipt_do_table(skb, hook, in, out,
+                                   dev_net(out)->ipv4.iptable_mangle);
        /* PREROUTING/INPUT/FORWARD: */
        return ipt_do_table(skb, hook, in, out,
                            dev_net(in)->ipv4.iptable_mangle);