Skip to content

Commit

Permalink
netfilter: assign PDE->data before gluing PDE into /proc tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed May 2, 2008
1 parent 52c0e11 commit 8b16924
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8b16924

Please sign in to comment.