ChangeSet 1.1448.114.5, 2005/03/04 00:48:18+01:00, [EMAIL PROTECTED]

        [NETFILTER]: Fix cleanup in ipt_recent
        
        Backport from 2.6, original patch from Rusty:
        
        When ipt_register_match() fails, ipt_recent doesn't remove its proc
        entry.  Found by nfsim.
        
        Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>



 ipt_recent.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


diff -Nru a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
--- a/net/ipv4/netfilter/ipt_recent.c   2005-03-25 17:02:47 -08:00
+++ b/net/ipv4/netfilter/ipt_recent.c   2005-03-25 17:02:47 -08:00
@@ -962,7 +962,7 @@
 /* Kernel module initialization. */
 static int __init init(void)
 {
-       int count;
+       int err, count;
 
        printk(version);
 #ifdef CONFIG_PROC_FS
@@ -986,7 +986,10 @@
        if(debug) printk(KERN_INFO RECENT_NAME ": ip_list_hash_size: 
%d\n",ip_list_hash_size);
 #endif
 
-       return ipt_register_match(&recent_match);
+       err = ipt_register_match(&recent_match);
+       if (err)
+               remove_proc_entry("ipt_recent", proc_net);
+       return err;
 }
 
 /* Kernel module destruction. */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to