diff options
author | Denis V. Lunev <den@openvz.org> | 2008-05-02 07:11:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-02 07:11:52 -0400 |
commit | 8b169240e266d7fc58d9b9077d18d50a548d9732 (patch) | |
tree | fcb06484789b34c0d1bd80575f685a4392a4d7a0 /net/netfilter | |
parent | 52c0e111fa082082060c4d43c05f20b756d5f06a (diff) |
netfilter: assign PDE->data before gluing PDE into /proc tree
Replace proc_net_fops_create with proc_create_data.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/x_tables.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 11b22abc2b7..5d75cd86ebb 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -936,25 +936,24 @@ int xt_proto_init(struct net *net, int af) | |||
936 | #ifdef CONFIG_PROC_FS | 936 | #ifdef CONFIG_PROC_FS |
937 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 937 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
938 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); | 938 | strlcat(buf, FORMAT_TABLES, sizeof(buf)); |
939 | proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops); | 939 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_table_ops, |
940 | (void *)(unsigned long)af); | ||
940 | if (!proc) | 941 | if (!proc) |
941 | goto out; | 942 | goto out; |
942 | proc->data = (void *)(unsigned long)af; | ||
943 | |||
944 | 943 | ||
945 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 944 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
946 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); | 945 | strlcat(buf, FORMAT_MATCHES, sizeof(buf)); |
947 | proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops); | 946 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_match_ops, |
947 | (void *)(unsigned long)af); | ||
948 | if (!proc) | 948 | if (!proc) |
949 | goto out_remove_tables; | 949 | goto out_remove_tables; |
950 | proc->data = (void *)(unsigned long)af; | ||
951 | 950 | ||
952 | strlcpy(buf, xt_prefix[af], sizeof(buf)); | 951 | strlcpy(buf, xt_prefix[af], sizeof(buf)); |
953 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); | 952 | strlcat(buf, FORMAT_TARGETS, sizeof(buf)); |
954 | proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops); | 953 | proc = proc_create_data(buf, 0440, net->proc_net, &xt_target_ops, |
954 | (void *)(unsigned long)af); | ||
955 | if (!proc) | 955 | if (!proc) |
956 | goto out_remove_matches; | 956 | goto out_remove_matches; |
957 | proc->data = (void *)(unsigned long)af; | ||
958 | #endif | 957 | #endif |
959 | 958 | ||
960 | return 0; | 959 | return 0; |