]> err.no Git - linux-2.6/blobdiff - net/bridge/netfilter/ebtables.c
[NETFILTER]: Replace sk_buff ** with sk_buff *
[linux-2.6] / net / bridge / netfilter / ebtables.c
index 6c84ccb8c9d754d045bc6351812917f6cfbd3cb3..d5a09eaef9153b6858fc3cecf44a777c002902bf 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 /* used for print_string */
-#include <linux/sched.h>
 #include <linux/tty.h>
 
 #include <linux/kmod.h>
 #include "../br_private.h"
 
 #define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
-                                         "report to author: "format, ## args)
+                                        "report to author: "format, ## args)
 /* #define BUGPRINT(format, args...) */
 #define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
-                                         ": out of memory: "format, ## args)
+                                        ": out of memory: "format, ## args)
 /* #define MEMPRINT(format, args...) */
 
 
@@ -143,7 +142,7 @@ static inline int ebt_basic_match(struct ebt_entry *e, struct ethhdr *h,
 }
 
 /* Do some firewalling */
-unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
+unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb,
    const struct net_device *in, const struct net_device *out,
    struct ebt_table *table)
 {
@@ -173,19 +172,19 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
        base = private->entries;
        i = 0;
        while (i < nentries) {
-               if (ebt_basic_match(point, eth_hdr(*pskb), in, out))
+               if (ebt_basic_match(point, eth_hdr(skb), in, out))
                        goto letscontinue;
 
-               if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0)
+               if (EBT_MATCH_ITERATE(point, ebt_do_match, skb, in, out) != 0)
                        goto letscontinue;
 
                /* increase counter */
                (*(counter_base + i)).pcnt++;
-               (*(counter_base + i)).bcnt+=(**pskb).len;
+               (*(counter_base + i)).bcnt += skb->len;
 
                /* these should only watch: not modify, nor tell us
                   what to do with the packet */
-               EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, hook, in,
+               EBT_WATCHER_ITERATE(point, ebt_do_watcher, skb, hook, in,
                   out);
 
                t = (struct ebt_entry_target *)
@@ -194,7 +193,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
                if (!t->u.target->target)
                        verdict = ((struct ebt_standard_target *)t)->verdict;
                else
-                       verdict = t->u.target->target(pskb, hook,
+                       verdict = t->u.target->target(skb, hook,
                           in, out, t->data, t->target_size);
                if (verdict == EBT_ACCEPT) {
                        read_unlock_bh(&table->lock);
@@ -482,7 +481,7 @@ ebt_check_entry_size_and_hooks(struct ebt_entry *e,
                   as it said it has */
                if (*n != *cnt) {
                        BUGPRINT("nentries does not equal the nr of entries "
-                                "in the chain\n");
+                                "in the chain\n");
                        return -EINVAL;
                }
                if (((struct ebt_entries *)e)->policy != EBT_DROP &&
@@ -809,7 +808,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
        i = 0; /* holds the expected nr. of entries for the chain */
        j = 0; /* holds the up to now counted entries for the chain */
        k = 0; /* holds the total nr. of entries, should equal
-                 newinfo->nentries afterwards */
+                 newinfo->nentries afterwards */
        udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */
        ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
           ebt_check_entry_size_and_hooks, newinfo,
@@ -820,7 +819,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
 
        if (i != j) {
                BUGPRINT("nentries does not equal the nr of entries in the "
-                        "(last) chain\n");
+                        "(last) chain\n");
                return -EINVAL;
        }
        if (k != newinfo->nentries) {
@@ -834,8 +833,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
                /* this will get free'd in do_replace()/ebt_register_table()
                   if an error occurs */
                newinfo->chainstack =
-                       vmalloc((highest_possible_processor_id()+1)
-                                       * sizeof(*(newinfo->chainstack)));
+                       vmalloc(nr_cpu_ids * sizeof(*(newinfo->chainstack)));
                if (!newinfo->chainstack)
                        return -ENOMEM;
                for_each_possible_cpu(i) {
@@ -948,8 +946,7 @@ static int do_replace(void __user *user, unsigned int len)
        if (tmp.num_counters >= INT_MAX / sizeof(struct ebt_counter))
                return -ENOMEM;
 
-       countersize = COUNTER_OFFSET(tmp.nentries) * 
-                                       (highest_possible_processor_id()+1);
+       countersize = COUNTER_OFFSET(tmp.nentries) * nr_cpu_ids;
        newinfo = vmalloc(sizeof(*newinfo) + countersize);
        if (!newinfo)
                return -ENOMEM;
@@ -1169,8 +1166,7 @@ int ebt_register_table(struct ebt_table *table)
                return -EINVAL;
        }
 
-       countersize = COUNTER_OFFSET(repl->nentries) *
-                                       (highest_possible_processor_id()+1);
+       countersize = COUNTER_OFFSET(repl->nentries) * nr_cpu_ids;
        newinfo = vmalloc(sizeof(*newinfo) + countersize);
        ret = -ENOMEM;
        if (!newinfo)
@@ -1350,7 +1346,7 @@ static inline int ebt_make_names(struct ebt_entry *e, char *base, char __user *u
 
        hlp = ubase + (((char *)e + e->target_offset) - base);
        t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-       
+
        ret = EBT_MATCH_ITERATE(e, ebt_make_matchname, base, ubase);
        if (ret != 0)
                return ret;
@@ -1517,6 +1513,7 @@ static struct nf_sockopt_ops ebt_sockopts =
        .get_optmin     = EBT_BASE_CTL,
        .get_optmax     = EBT_SO_GET_MAX + 1,
        .get            = do_ebt_get_ctl,
+       .owner          = THIS_MODULE,
 };
 
 static int __init ebtables_init(void)
@@ -1529,14 +1526,14 @@ static int __init ebtables_init(void)
        if ((ret = nf_register_sockopt(&ebt_sockopts)) < 0)
                return ret;
 
-       printk(KERN_NOTICE "Ebtables v2.0 registered\n");
+       printk(KERN_INFO "Ebtables v2.0 registered\n");
        return 0;
 }
 
 static void __exit ebtables_fini(void)
 {
        nf_unregister_sockopt(&ebt_sockopts);
-       printk(KERN_NOTICE "Ebtables v2.0 unregistered\n");
+       printk(KERN_INFO "Ebtables v2.0 unregistered\n");
 }
 
 EXPORT_SYMBOL(ebt_register_table);