aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-03-01 05:55:33 -0500
committerPatrick McHardy <kaber@trash.net>2010-03-17 10:53:11 -0400
commit5be4a4f589841ef06fd79b241de3d5353a6c5efa (patch)
treed2c85b4a0d40087117fb75c548cdcc9b1d9ea81b
parent06bf514e3199150c715ab72e8e0e335ae8f99666 (diff)
netfilter: xt_recent: remove old proc directory
The compat option was introduced in October 2008. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--Documentation/feature-removal-schedule.txt10
-rw-r--r--net/netfilter/Kconfig7
-rw-r--r--net/netfilter/xt_recent.c105
3 files changed, 0 insertions, 122 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index fa327f673a32..ea227e3f528b 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -241,16 +241,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>
241 241
242--------------------------- 242---------------------------
243 243
244What (Why):
245 - xt_recent: the old ipt_recent proc dir
246 (superseded by /proc/net/xt_recent)
247
248When: January 2009 or Linux 2.7.0, whichever comes first
249Why: Superseded by newer revisions or modules
250Who: Jan Engelhardt <jengelh@medozas.de>
251
252---------------------------
253
254What: GPIO autorequest on gpio_direction_{input,output}() in gpiolib 244What: GPIO autorequest on gpio_direction_{input,output}() in gpiolib
255When: February 2010 245When: February 2010
256Why: All callers should use explicit gpio_request()/gpio_free(). 246Why: All callers should use explicit gpio_request()/gpio_free().
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 8550dfde7804..6ac28ef9300c 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -859,13 +859,6 @@ config NETFILTER_XT_MATCH_RECENT
859 Short options are available by using 'iptables -m recent -h' 859 Short options are available by using 'iptables -m recent -h'
860 Official Website: <http://snowman.net/projects/ipt_recent/> 860 Official Website: <http://snowman.net/projects/ipt_recent/>
861 861
862config NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
863 bool 'Enable obsolete /proc/net/ipt_recent'
864 depends on NETFILTER_XT_MATCH_RECENT && PROC_FS
865 ---help---
866 This option enables the old /proc/net/ipt_recent interface,
867 which has been obsoleted by /proc/net/xt_recent.
868
869config NETFILTER_XT_MATCH_SCTP 862config NETFILTER_XT_MATCH_SCTP
870 tristate '"sctp" protocol match support (EXPERIMENTAL)' 863 tristate '"sctp" protocol match support (EXPERIMENTAL)'
871 depends on EXPERIMENTAL 864 depends on EXPERIMENTAL
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index bcabfbc1cd05..2ff8aae84a38 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -83,9 +83,6 @@ struct recent_net {
83 struct list_head tables; 83 struct list_head tables;
84#ifdef CONFIG_PROC_FS 84#ifdef CONFIG_PROC_FS
85 struct proc_dir_entry *xt_recent; 85 struct proc_dir_entry *xt_recent;
86#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
87 struct proc_dir_entry *ipt_recent;
88#endif
89#endif 86#endif
90}; 87};
91 88
@@ -342,17 +339,6 @@ static bool recent_mt_check(const struct xt_mtchk_param *par)
342 } 339 }
343 pde->uid = ip_list_uid; 340 pde->uid = ip_list_uid;
344 pde->gid = ip_list_gid; 341 pde->gid = ip_list_gid;
345#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
346 pde = proc_create_data(t->name, ip_list_perms, recent_net->ipt_recent,
347 &recent_old_fops, t);
348 if (pde == NULL) {
349 remove_proc_entry(t->name, recent_net->xt_recent);
350 kfree(t);
351 goto out;
352 }
353 pde->uid = ip_list_uid;
354 pde->gid = ip_list_gid;
355#endif
356#endif 342#endif
357 spin_lock_bh(&recent_lock); 343 spin_lock_bh(&recent_lock);
358 list_add_tail(&t->list, &recent_net->tables); 344 list_add_tail(&t->list, &recent_net->tables);
@@ -376,9 +362,6 @@ static void recent_mt_destroy(const struct xt_mtdtor_param *par)
376 list_del(&t->list); 362 list_del(&t->list);
377 spin_unlock_bh(&recent_lock); 363 spin_unlock_bh(&recent_lock);
378#ifdef CONFIG_PROC_FS 364#ifdef CONFIG_PROC_FS
379#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
380 remove_proc_entry(t->name, recent_net->ipt_recent);
381#endif
382 remove_proc_entry(t->name, recent_net->xt_recent); 365 remove_proc_entry(t->name, recent_net->xt_recent);
383#endif 366#endif
384 recent_table_flush(t); 367 recent_table_flush(t);
@@ -470,84 +453,6 @@ static int recent_seq_open(struct inode *inode, struct file *file)
470 return 0; 453 return 0;
471} 454}
472 455
473#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
474static int recent_old_seq_open(struct inode *inode, struct file *filp)
475{
476 static bool warned_of_old;
477
478 if (unlikely(!warned_of_old)) {
479 printk(KERN_INFO KBUILD_MODNAME ": Use of /proc/net/ipt_recent"
480 " is deprecated; use /proc/net/xt_recent.\n");
481 warned_of_old = true;
482 }
483 return recent_seq_open(inode, filp);
484}
485
486static ssize_t recent_old_proc_write(struct file *file,
487 const char __user *input,
488 size_t size, loff_t *loff)
489{
490 const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
491 struct recent_table *t = pde->data;
492 struct recent_entry *e;
493 char buf[sizeof("+255.255.255.255")], *c = buf;
494 union nf_inet_addr addr = {};
495 int add;
496
497 if (size > sizeof(buf))
498 size = sizeof(buf);
499 if (copy_from_user(buf, input, size))
500 return -EFAULT;
501
502 c = skip_spaces(c);
503
504 if (size - (c - buf) < 5)
505 return c - buf;
506 if (!strncmp(c, "clear", 5)) {
507 c += 5;
508 spin_lock_bh(&recent_lock);
509 recent_table_flush(t);
510 spin_unlock_bh(&recent_lock);
511 return c - buf;
512 }
513
514 switch (*c) {
515 case '-':
516 add = 0;
517 c++;
518 break;
519 case '+':
520 c++;
521 default:
522 add = 1;
523 break;
524 }
525 addr.ip = in_aton(c);
526
527 spin_lock_bh(&recent_lock);
528 e = recent_entry_lookup(t, &addr, NFPROTO_IPV4, 0);
529 if (e == NULL) {
530 if (add)
531 recent_entry_init(t, &addr, NFPROTO_IPV4, 0);
532 } else {
533 if (add)
534 recent_entry_update(t, e);
535 else
536 recent_entry_remove(t, e);
537 }
538 spin_unlock_bh(&recent_lock);
539 return size;
540}
541
542static const struct file_operations recent_old_fops = {
543 .open = recent_old_seq_open,
544 .read = seq_read,
545 .write = recent_old_proc_write,
546 .release = seq_release_private,
547 .owner = THIS_MODULE,
548};
549#endif
550
551static ssize_t 456static ssize_t
552recent_mt_proc_write(struct file *file, const char __user *input, 457recent_mt_proc_write(struct file *file, const char __user *input,
553 size_t size, loff_t *loff) 458 size_t size, loff_t *loff)
@@ -636,21 +541,11 @@ static int __net_init recent_proc_net_init(struct net *net)
636 recent_net->xt_recent = proc_mkdir("xt_recent", net->proc_net); 541 recent_net->xt_recent = proc_mkdir("xt_recent", net->proc_net);
637 if (!recent_net->xt_recent) 542 if (!recent_net->xt_recent)
638 return -ENOMEM; 543 return -ENOMEM;
639#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
640 recent_net->ipt_recent = proc_mkdir("ipt_recent", net->proc_net);
641 if (!recent_net->ipt_recent) {
642 proc_net_remove(net, "xt_recent");
643 return -ENOMEM;
644 }
645#endif
646 return 0; 544 return 0;
647} 545}
648 546
649static void __net_exit recent_proc_net_exit(struct net *net) 547static void __net_exit recent_proc_net_exit(struct net *net)
650{ 548{
651#ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
652 proc_net_remove(net, "ipt_recent");
653#endif
654 proc_net_remove(net, "xt_recent"); 549 proc_net_remove(net, "xt_recent");
655} 550}
656#else 551#else