Pull misc into release branch
[pandora-kernel.git] / net / netfilter / x_tables.c
index ec607a4..cc2baa6 100644 (file)
@@ -56,8 +56,8 @@ enum {
 };
 
 static const char *xt_prefix[NPROTO] = {
-       [AF_INET]       = "ip",
-       [AF_INET6]      = "ip6",
+       [AF_INET]       = "ip",
+       [AF_INET6]      = "ip6",
        [NF_ARP]        = "arp",
 };
 
@@ -320,8 +320,8 @@ int xt_check_match(const struct xt_match *match, unsigned short family,
                return -EINVAL;
        }
        if (match->hooks && (hook_mask & ~match->hooks) != 0) {
-               printk("%s_tables: %s match: bad hook_mask %u\n",
-                      xt_prefix[family], match->name, hook_mask);
+               printk("%s_tables: %s match: bad hook_mask %u/%u\n",
+                      xt_prefix[family], match->name, hook_mask, match->hooks);
                return -EINVAL;
        }
        if (match->proto && (match->proto != proto || inv_proto)) {
@@ -410,8 +410,9 @@ int xt_check_target(const struct xt_target *target, unsigned short family,
                return -EINVAL;
        }
        if (target->hooks && (hook_mask & ~target->hooks) != 0) {
-               printk("%s_tables: %s target: bad hook_mask %u\n",
-                      xt_prefix[family], target->name, hook_mask);
+               printk("%s_tables: %s target: bad hook_mask %u/%u\n",
+                      xt_prefix[family], target->name, hook_mask,
+                      target->hooks);
                return -EINVAL;
        }
        if (target->proto && (target->proto != proto || inv_proto)) {
@@ -651,12 +652,6 @@ void *xt_unregister_table(struct xt_table *table)
 EXPORT_SYMBOL_GPL(xt_unregister_table);
 
 #ifdef CONFIG_PROC_FS
-static char *xt_proto_prefix[NPROTO] = {
-       [AF_INET]       = "ip",
-       [AF_INET6]      = "ip6",
-       [NF_ARP]        = "arp",
-};
-
 static struct list_head *xt_get_idx(struct list_head *list, struct seq_file *seq, loff_t pos)
 {
        struct list_head *head = list->next;
@@ -750,7 +745,7 @@ static int xt_name_seq_show(struct seq_file *seq, void *v)
                return 0;
 }
 
-static struct seq_operations xt_tgt_seq_ops = {
+static const struct seq_operations xt_tgt_seq_ops = {
        .start  = xt_tgt_seq_start,
        .next   = xt_tgt_seq_next,
        .stop   = xt_tgt_seq_stop,
@@ -798,7 +793,7 @@ int xt_proto_init(int af)
 
 
 #ifdef CONFIG_PROC_FS
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_TABLES, sizeof(buf));
        proc = proc_net_fops_create(buf, 0440, &xt_file_ops);
        if (!proc)
@@ -806,14 +801,14 @@ int xt_proto_init(int af)
        proc->data = (void *) ((unsigned long) af | (TABLE << 16));
 
 
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_MATCHES, sizeof(buf));
        proc = proc_net_fops_create(buf, 0440, &xt_file_ops);
        if (!proc)
                goto out_remove_tables;
        proc->data = (void *) ((unsigned long) af | (MATCH << 16));
 
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_TARGETS, sizeof(buf));
        proc = proc_net_fops_create(buf, 0440, &xt_file_ops);
        if (!proc)
@@ -825,12 +820,12 @@ int xt_proto_init(int af)
 
 #ifdef CONFIG_PROC_FS
 out_remove_matches:
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_MATCHES, sizeof(buf));
        proc_net_remove(buf);
 
 out_remove_tables:
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_TABLES, sizeof(buf));
        proc_net_remove(buf);
 out:
@@ -844,15 +839,15 @@ void xt_proto_fini(int af)
 #ifdef CONFIG_PROC_FS
        char buf[XT_FUNCTION_MAXNAMELEN];
 
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_TABLES, sizeof(buf));
        proc_net_remove(buf);
 
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_TARGETS, sizeof(buf));
        proc_net_remove(buf);
 
-       strlcpy(buf, xt_proto_prefix[af], sizeof(buf));
+       strlcpy(buf, xt_prefix[af], sizeof(buf));
        strlcat(buf, FORMAT_MATCHES, sizeof(buf));
        proc_net_remove(buf);
 #endif /*CONFIG_PROC_FS*/