diff options
author | Denis V. Lunev <den@openvz.org> | 2008-05-02 04:11:52 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-02 04:11:52 -0700 |
commit | 8b169240e266d7fc58d9b9077d18d50a548d9732 (patch) | |
tree | fcb06484789b34c0d1bd80575f685a4392a4d7a0 /net | |
parent | 52c0e111fa082082060c4d43c05f20b756d5f06a (diff) | |
download | op-kernel-dev-8b169240e266d7fc58d9b9077d18d50a548d9732.zip op-kernel-dev-8b169240e266d7fc58d9b9077d18d50a548d9732.tar.gz |
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')
-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 11b22ab..5d75cd8 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) #ifdef CONFIG_PROC_FS strlcpy(buf, xt_prefix[af], sizeof(buf)); strlcat(buf, FORMAT_TABLES, sizeof(buf)); - proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops); + proc = proc_create_data(buf, 0440, net->proc_net, &xt_table_ops, + (void *)(unsigned long)af); if (!proc) goto out; - proc->data = (void *)(unsigned long)af; - strlcpy(buf, xt_prefix[af], sizeof(buf)); strlcat(buf, FORMAT_MATCHES, sizeof(buf)); - proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops); + proc = proc_create_data(buf, 0440, net->proc_net, &xt_match_ops, + (void *)(unsigned long)af); if (!proc) goto out_remove_tables; - proc->data = (void *)(unsigned long)af; strlcpy(buf, xt_prefix[af], sizeof(buf)); strlcat(buf, FORMAT_TARGETS, sizeof(buf)); - proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops); + proc = proc_create_data(buf, 0440, net->proc_net, &xt_target_ops, + (void *)(unsigned long)af); if (!proc) goto out_remove_matches; - proc->data = (void *)(unsigned long)af; #endif return 0; |