diff options
-rw-r--r-- | net/netfilter/x_tables.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index ec607a421a5a..0eb2504b89b5 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -56,8 +56,8 @@ enum { | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | static const char *xt_prefix[NPROTO] = { | 58 | static const char *xt_prefix[NPROTO] = { |
59 | [AF_INET] = "ip", | 59 | [AF_INET] = "ip", |
60 | [AF_INET6] = "ip6", | 60 | [AF_INET6] = "ip6", |
61 | [NF_ARP] = "arp", | 61 | [NF_ARP] = "arp", |
62 | }; | 62 | }; |
63 | 63 | ||
@@ -651,12 +651,6 @@ void *xt_unregister_table(struct xt_table *table) | |||
651 | EXPORT_SYMBOL_GPL(xt_unregister_table); | 651 | EXPORT_SYMBOL_GPL(xt_unregister_table); |
652 | 652 | ||
653 | #ifdef CONFIG_PROC_FS | 653 | #ifdef CONFIG_PROC_FS |
654 | static char *xt_proto_prefix[NPROTO] = { | ||
655 | [AF_INET] = "ip", | ||
656 | [AF_INET6] = "ip6", | ||
657 | [NF_ARP] = "arp", | ||
658 | }; | ||
659 | |||
660 | static struct list_head *xt_get_idx(struct list_head *list, struct seq_file *seq, loff_t pos) | 654 | static struct list_head *xt_get_idx(struct list_head *list, struct seq_file *seq, loff_t pos) |
661 | { | 655 | { |
662 | struct list_head *head = list->next; | 656 | struct list_head *head = list->next; |
@@ -798,7 +792,7 @@ int xt_proto_init(int af) | |||
798 | 792 | ||
799 | 793 | ||
800 | #ifdef CONFIG_PROC_FS | 794 | #ifdef CONFIG_PROC_FS |
801 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 795 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
802 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); | 796 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); |
803 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); | 797 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); |
804 | if (!proc) | 798 | if (!proc) |
@@ -806,14 +800,14 @@ int xt_proto_init(int af) | |||
806 | proc->data = (void *) ((unsigned long) af | (TABLE << 16)); | 800 | proc->data = (void *) ((unsigned long) af | (TABLE << 16)); |
807 | 801 | ||
808 | 802 | ||
809 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 803 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
810 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); | 804 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); |
811 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); | 805 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); |
812 | if (!proc) | 806 | if (!proc) |
813 | goto out_remove_tables; | 807 | goto out_remove_tables; |
814 | proc->data = (void *) ((unsigned long) af | (MATCH << 16)); | 808 | proc->data = (void *) ((unsigned long) af | (MATCH << 16)); |
815 | 809 | ||
816 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 810 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
817 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); | 811 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); |
818 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); | 812 | proc = proc_net_fops_create(buf, 0440, &xt_file_ops); |
819 | if (!proc) | 813 | if (!proc) |
@@ -825,12 +819,12 @@ int xt_proto_init(int af) | |||
825 | 819 | ||
826 | #ifdef CONFIG_PROC_FS | 820 | #ifdef CONFIG_PROC_FS |
827 | out_remove_matches: | 821 | out_remove_matches: |
828 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 822 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
829 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); | 823 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); |
830 | proc_net_remove(buf); | 824 | proc_net_remove(buf); |
831 | 825 | ||
832 | out_remove_tables: | 826 | out_remove_tables: |
833 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 827 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
834 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); | 828 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); |
835 | proc_net_remove(buf); | 829 | proc_net_remove(buf); |
836 | out: | 830 | out: |
@@ -844,15 +838,15 @@ void xt_proto_fini(int af) | |||
844 | #ifdef CONFIG_PROC_FS | 838 | #ifdef CONFIG_PROC_FS |
845 | char buf[XT_FUNCTION_MAXNAMELEN]; | 839 | char buf[XT_FUNCTION_MAXNAMELEN]; |
846 | 840 | ||
847 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 841 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
848 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); | 842 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); |
849 | proc_net_remove(buf); | 843 | proc_net_remove(buf); |
850 | 844 | ||
851 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 845 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
852 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); | 846 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); |
853 | proc_net_remove(buf); | 847 | proc_net_remove(buf); |
854 | 848 | ||
855 | strlcpy(buf, xt_proto_prefix[af], sizeof(buf)); | 849 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
856 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); | 850 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); |
857 | proc_net_remove(buf); | 851 | proc_net_remove(buf); |
858 | #endif /*CONFIG_PROC_FS*/ | 852 | #endif /*CONFIG_PROC_FS*/ |