Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / net / netfilter / xt_connmark.c
index 94d5251b3d88a14867c3ec20e5f5bb1ea4483b55..1071fc54d6d3c8811f4404773636ec15083d9cc3 100644 (file)
@@ -29,6 +29,7 @@ MODULE_AUTHOR("Henrik Nordstrom <hno@marasytems.com>");
 MODULE_DESCRIPTION("IP tables connmark match module");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("ipt_connmark");
+MODULE_ALIAS("ip6t_connmark");
 
 static bool
 match(const struct sk_buff *skb,
@@ -41,14 +42,14 @@ match(const struct sk_buff *skb,
       bool *hotdrop)
 {
        const struct xt_connmark_info *info = matchinfo;
-       struct nf_conn *ct;
+       const struct nf_conn *ct;
        enum ip_conntrack_info ctinfo;
 
        ct = nf_ct_get(skb, &ctinfo);
        if (!ct)
                return false;
 
-       return (((ct->mark) & info->mask) == info->mark) ^ info->invert;
+       return ((ct->mark & info->mask) == info->mark) ^ info->invert;
 }
 
 static bool
@@ -58,7 +59,7 @@ checkentry(const char *tablename,
           void *matchinfo,
           unsigned int hook_mask)
 {
-       struct xt_connmark_info *cm = matchinfo;
+       const struct xt_connmark_info *cm = matchinfo;
 
        if (cm->mark > 0xffffffff || cm->mask > 0xffffffff) {
                printk(KERN_WARNING "connmark: only support 32bit mark\n");
@@ -88,7 +89,7 @@ struct compat_xt_connmark_info {
 
 static void compat_from_user(void *dst, void *src)
 {
-       struct compat_xt_connmark_info *cm = src;
+       const struct compat_xt_connmark_info *cm = src;
        struct xt_connmark_info m = {
                .mark   = cm->mark,
                .mask   = cm->mask,
@@ -99,7 +100,7 @@ static void compat_from_user(void *dst, void *src)
 
 static int compat_to_user(void __user *dst, void *src)
 {
-       struct xt_connmark_info *m = src;
+       const struct xt_connmark_info *m = src;
        struct compat_xt_connmark_info cm = {
                .mark   = m->mark,
                .mask   = m->mask,
@@ -109,7 +110,7 @@ static int compat_to_user(void __user *dst, void *src)
 }
 #endif /* CONFIG_COMPAT */
 
-static struct xt_match xt_connmark_match[] = {
+static struct xt_match xt_connmark_match[] __read_mostly = {
        {
                .name           = "connmark",
                .family         = AF_INET,