Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348368
b: refs/heads/master
c: 665e205
h: refs/heads/master
v: v3
  • Loading branch information
Vitaly E. Lavrov authored and Pablo Neira Ayuso committed Dec 26, 2012
1 parent 160ff76 commit 874d151
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09181842b000344b1205801df3aa5b726c03cc62
refs/heads/master: 665e205c16c1f902ac6763b8ce8a0a3a1dcefe59
20 changes: 16 additions & 4 deletions trunk/net/netfilter/xt_recent.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ static void recent_mt_destroy(const struct xt_mtdtor_param *par)
list_del(&t->list);
spin_unlock_bh(&recent_lock);
#ifdef CONFIG_PROC_FS
remove_proc_entry(t->name, recent_net->xt_recent);
if (recent_net->xt_recent != NULL)
remove_proc_entry(t->name, recent_net->xt_recent);
#endif
recent_table_flush(t);
kfree(t);
Expand Down Expand Up @@ -615,6 +616,20 @@ static int __net_init recent_proc_net_init(struct net *net)

static void __net_exit recent_proc_net_exit(struct net *net)
{
struct recent_net *recent_net = recent_pernet(net);
struct recent_table *t;

/* recent_net_exit() is called before recent_mt_destroy(). Make sure
* that the parent xt_recent proc entry is is empty before trying to
* remove it.
*/
spin_lock_bh(&recent_lock);
list_for_each_entry(t, &recent_net->tables, list)
remove_proc_entry(t->name, recent_net->xt_recent);

recent_net->xt_recent = NULL;
spin_unlock_bh(&recent_lock);

proc_net_remove(net, "xt_recent");
}
#else
Expand All @@ -638,9 +653,6 @@ static int __net_init recent_net_init(struct net *net)

static void __net_exit recent_net_exit(struct net *net)
{
struct recent_net *recent_net = recent_pernet(net);

BUG_ON(!list_empty(&recent_net->tables));
recent_proc_net_exit(net);
}

Expand Down

0 comments on commit 874d151

Please sign in to comment.