Re: [PATCH 2/8] [NETFILTER]: xt_recent: IPv6 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 2008-04-09 15:30, Patrick McHardy wrote:
> Patrick McHardy wrote:
>> Jan Engelhardt wrote:
>> > This updates xt_recent to support the IPv6 address family.
>> > The new /proc/net/xt_recent directory must be used for this.
>> >
>> Could you introduce a new option for this please? Something
>> like CONFIG_NF_CONNTRACK_PROC_COMPAT.
>
> BTW, it would be great if you could send me this patch before
> anything else since my tree has grown too much and I intend
> to push the first batch to Dave later and would like to already
> include the hashlimit patch in this batch.
>
Adding an extra option to compile out the old stuff makes
for lots of ugly #ifdefs. Not want to do that.

old+new:
   text    data     bss     dec     hex filename
   6207     308      25    6540    198c net/netfilter/xt_recent.o

only new stuff:
   text    data     bss     dec     hex filename
   3636     312      21    3969     f81 net/netfilter/xt_recent.o

yes, it's a bit costly on text it seems, but I think can live with it
for the time being.
But you get the desired printk warning for folding:


commit 0c7a7d8f537998216715cce64a0d8f62de001e99
Author: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
Date:   Wed Apr 9 15:43:58 2008 +0200

    xt_recent: warn about old proc
---
 net/netfilter/xt_recent.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 134529b..8d571ed 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -456,6 +456,18 @@ static int recent_seq_open(struct inode *inode, struct file *file)
 	return 0;
 }
 
+static int recent_old_seq_open(struct inode *inode, struct file *filp)
+{
+	static bool warned_of_old;
+
+	if (unlikely(!warned_of_old)) {
+		printk(KERN_INFO KBUILD_MODNAME ": Use of /proc/net/ipt_recent"
+		       " is deprecated; use /proc/net/xt_recent.\n");
+		warned_of_old = true;
+	}
+	return recent_seq_open(inode, filp);
+}
+
 static ssize_t recent_old_proc_write(struct file *file,
 				     const char __user *input,
 				     size_t size, loff_t *loff)
@@ -587,7 +599,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
 }
 
 static const struct file_operations recent_old_fops = {
-	.open		= recent_seq_open,
+	.open		= recent_old_seq_open,
 	.read		= seq_read,
 	.write		= recent_old_proc_write,
 	.release	= seq_release_private,
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux