netfilter: xt_recent: don't save proc dirs
Not needed, since creation and removal are done by name. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
e17b666a46
commit
b0ceb560a4
|
@ -72,9 +72,6 @@ struct recent_entry {
|
||||||
struct recent_table {
|
struct recent_table {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
char name[XT_RECENT_NAME_LEN];
|
char name[XT_RECENT_NAME_LEN];
|
||||||
#ifdef CONFIG_PROC_FS
|
|
||||||
struct proc_dir_entry *proc_old, *proc;
|
|
||||||
#endif
|
|
||||||
unsigned int refcnt;
|
unsigned int refcnt;
|
||||||
unsigned int entries;
|
unsigned int entries;
|
||||||
struct list_head lru_list;
|
struct list_head lru_list;
|
||||||
|
@ -284,6 +281,9 @@ static bool recent_mt_check(const struct xt_mtchk_param *par)
|
||||||
{
|
{
|
||||||
const struct xt_recent_mtinfo *info = par->matchinfo;
|
const struct xt_recent_mtinfo *info = par->matchinfo;
|
||||||
struct recent_table *t;
|
struct recent_table *t;
|
||||||
|
#ifdef CONFIG_PROC_FS
|
||||||
|
struct proc_dir_entry *pde;
|
||||||
|
#endif
|
||||||
unsigned i;
|
unsigned i;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
|
@ -318,25 +318,25 @@ static bool recent_mt_check(const struct xt_mtchk_param *par)
|
||||||
for (i = 0; i < ip_list_hash_size; i++)
|
for (i = 0; i < ip_list_hash_size; i++)
|
||||||
INIT_LIST_HEAD(&t->iphash[i]);
|
INIT_LIST_HEAD(&t->iphash[i]);
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
t->proc = proc_create_data(t->name, ip_list_perms, recent_proc_dir,
|
pde = proc_create_data(t->name, ip_list_perms, recent_proc_dir,
|
||||||
&recent_mt_fops, t);
|
&recent_mt_fops, t);
|
||||||
if (t->proc == NULL) {
|
if (pde == NULL) {
|
||||||
kfree(t);
|
kfree(t);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
pde->uid = ip_list_uid;
|
||||||
|
pde->gid = ip_list_gid;
|
||||||
#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
|
#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
|
||||||
t->proc_old = proc_create_data(t->name, ip_list_perms, proc_old_dir,
|
pde = proc_create_data(t->name, ip_list_perms, proc_old_dir,
|
||||||
&recent_old_fops, t);
|
&recent_old_fops, t);
|
||||||
if (t->proc_old == NULL) {
|
if (pde == NULL) {
|
||||||
remove_proc_entry(t->name, proc_old_dir);
|
remove_proc_entry(t->name, proc_old_dir);
|
||||||
kfree(t);
|
kfree(t);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
t->proc_old->uid = ip_list_uid;
|
pde->uid = ip_list_uid;
|
||||||
t->proc_old->gid = ip_list_gid;
|
pde->gid = ip_list_gid;
|
||||||
#endif
|
#endif
|
||||||
t->proc->uid = ip_list_uid;
|
|
||||||
t->proc->gid = ip_list_gid;
|
|
||||||
#endif
|
#endif
|
||||||
spin_lock_bh(&recent_lock);
|
spin_lock_bh(&recent_lock);
|
||||||
list_add_tail(&t->list, &tables);
|
list_add_tail(&t->list, &tables);
|
||||||
|
|
Loading…
Reference in New Issue