]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sched/act_ipt.c
[NETFILTER]: Replace sk_buff ** with sk_buff *
[net-next-2.6.git] / net / sched / act_ipt.c
index 01e69138578da0cc9db6151493a3312d5573011c..fa006e06ce3308270b51211135e72cc978ef9b2b 100644 (file)
  * Copyright:  Jamal Hadi Salim (2002-4)
  */
 
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/bitops.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/socket.h>
-#include <linux/sockios.h>
-#include <linux/in.h>
 #include <linux/errno.h>
-#include <linux/interrupt.h>
-#include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/rtnetlink.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/proc_fs.h>
-#include <linux/kmod.h>
-#include <net/sock.h>
+#include <net/netlink.h>
 #include <net/pkt_sched.h>
 #include <linux/tc_act/tc_ipt.h>
 #include <net/tc_act/tc_ipt.h>
@@ -52,7 +40,7 @@ static struct tcf_hashinfo ipt_hash_info = {
 
 static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int hook)
 {
-       struct ipt_target *target;
+       struct xt_target *target;
        int ret = 0;
 
        target = xt_request_find_target(AF_INET, t->u.user.name,
@@ -70,7 +58,7 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
        }
        if (t->u.kernel.target->checkentry
            && !t->u.kernel.target->checkentry(table, NULL,
-                                              t->u.kernel.target, t->data,
+                                              t->u.kernel.target, t->data,
                                               hook)) {
                module_put(t->u.kernel.target->me);
                ret = -EINVAL;
@@ -83,7 +71,7 @@ static void ipt_destroy_target(struct ipt_entry_target *t)
 {
        if (t->u.kernel.target->destroy)
                t->u.kernel.target->destroy(t->u.kernel.target, t->data);
-        module_put(t->u.kernel.target->me);
+       module_put(t->u.kernel.target->me);
 }
 
 static int tcf_ipt_release(struct tcf_ipt *ipt, int bind)
@@ -214,11 +202,7 @@ static int tcf_ipt(struct sk_buff *skb, struct tc_action *a,
        /* yes, we have to worry about both in and out dev
         worry later - danger - this API seems to have changed
         from earlier kernels */
-
-       /* iptables targets take a double skb pointer in case the skb
-        * needs to be replaced. We don't own the skb, so this must not
-        * happen. The pskb_expand_head above should make sure of this */
-       ret = ipt->tcfi_t->u.kernel.target->target(&skb, skb->dev, NULL,
+       ret = ipt->tcfi_t->u.kernel.target->target(skb, skb->dev, NULL,
                                                   ipt->tcfi_hook,
                                                   ipt->tcfi_t->u.kernel.target,
                                                   ipt->tcfi_t->data);
@@ -246,7 +230,7 @@ static int tcf_ipt(struct sk_buff *skb, struct tc_action *a,
 
 static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
 {
-       unsigned char *b = skb->tail;
+       unsigned char *b = skb_tail_pointer(skb);
        struct tcf_ipt *ipt = a->priv;
        struct ipt_entry_target *t;
        struct tcf_t tm;
@@ -278,7 +262,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
        return skb->len;
 
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        kfree(t);
        return -1;
 }