]> err.no Git - linux-2.6/blobdiff - net/netfilter/xt_u32.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / net / netfilter / xt_u32.c
index 07068751a35cbd7122fb27ea88761c759fc116fe..af75b8c3f20b988af0df06b74382cee68e07c4cf 100644 (file)
@@ -2,7 +2,8 @@
  *     xt_u32 - kernel module to match u32 packet content
  *
  *     Original author: Don Cohen <don@isis.cs3-inc.com>
- *     © Jan Engelhardt <jengelh@gmx.de>, 2007
+ *     (C) CC Computer Consultants GmbH, 2007
+ *     Contact: <jengelh@computergmbh.de>
  */
 
 #include <linux/module.h>
@@ -21,6 +22,7 @@ static bool u32_match_it(const struct xt_u32 *data,
        unsigned int nnums;
        unsigned int nvals;
        unsigned int i;
+       __be32 n;
        u_int32_t pos;
        u_int32_t val;
        u_int32_t at;
@@ -35,12 +37,12 @@ static bool u32_match_it(const struct xt_u32 *data,
                at  = 0;
                pos = ct->location[0].number;
 
-               if (skb->len < 4 || pos > skb->len - 4);
+               if (skb->len < 4 || pos > skb->len - 4)
                        return false;
 
-               ret   = skb_copy_bits(skb, pos, &val, sizeof(val));
+               ret   = skb_copy_bits(skb, pos, &n, sizeof(n));
                BUG_ON(ret < 0);
-               val   = ntohl(val);
+               val   = ntohl(n);
                nnums = ct->nnums;
 
                /* Inner loop runs over "&", "<<", ">>" and "@" operands */
@@ -65,10 +67,10 @@ static bool u32_match_it(const struct xt_u32 *data,
                                    pos > skb->len - at - 4)
                                        return false;
 
-                               ret = skb_copy_bits(skb, at + pos, &val,
-                                                   sizeof(val));
+                               ret = skb_copy_bits(skb, at + pos, &n,
+                                                   sizeof(n));
                                BUG_ON(ret < 0);
-                               val = ntohl(val);
+                               val = ntohl(n);
                                break;
                        }
                }
@@ -99,7 +101,7 @@ static bool u32_match(const struct sk_buff *skb,
        return ret ^ data->invert;
 }
 
-static struct xt_match u32_reg[] = {
+static struct xt_match u32_reg[] __read_mostly = {
        {
                .name       = "u32",
                .family     = AF_INET,
@@ -128,7 +130,7 @@ static void __exit xt_u32_exit(void)
 
 module_init(xt_u32_init);
 module_exit(xt_u32_exit);
-MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>");
+MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>");
 MODULE_DESCRIPTION("netfilter u32 match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_u32");