All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Zacarias <gustavoz@gentoo.org>
To: sparclinux@vger.kernel.org
Subject: Re: 2.4 kernels and max # of rules with iptables
Date: Mon, 22 Aug 2005 17:10:28 +0000	[thread overview]
Message-ID: <430A0704.3000501@gentoo.org> (raw)
In-Reply-To: <20050619200712.036920e1@enterprise.weeve.org>


[-- Attachment #1.1: Type: text/plain, Size: 286 bytes --]

David S. Miller wrote:

> You _could_ experiment with making the code there use
> vmalloc()/vfree() instead, and if you get it working cleanly I'd be
> happy to add such a patch to fix this.

Tested with 5000+ rules.
Does it look clean enough?

-- 
Gustavo Zacarias
Gentoo/SPARC monkey

[-- Attachment #1.2: 2.4-sparc64-netfilter-ioctl32.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

diff -Nura linux-2.4.31/arch/sparc64/kernel/sys_sparc32.c linux-2.4.31.netfilter/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.4.31/arch/sparc64/kernel/sys_sparc32.c	2005-04-03 22:42:19.000000000 -0300
+++ linux-2.4.31.netfilter/arch/sparc64/kernel/sys_sparc32.c	2005-08-22 12:34:14.000000000 -0300
@@ -50,6 +50,7 @@
 #include <linux/in.h>
 #include <linux/icmpv6.h>
 #include <linux/sysctl.h>
+#include <linux/vmalloc.h>
 #include <linux/dnotify.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 
@@ -2919,12 +2920,12 @@
 	if (optlen != kreplsize)
 		return -ENOPROTOOPT;
 
-	krepl = (struct ipt_replace *)kmalloc(kreplsize, GFP_KERNEL);
+	krepl = (struct ipt_replace *)vmalloc(kreplsize);
 	if (krepl == NULL)
 		return -ENOMEM;
 
 	if (copy_from_user(krepl, optval, kreplsize)) {
-		kfree(krepl);
+		vfree(krepl);
 		return -EFAULT;
 	}
 
@@ -2935,7 +2936,7 @@
 	krepl->counters = (struct ipt_counters *)kmalloc(
 					kcountersize, GFP_KERNEL);
 	if (krepl->counters == NULL) {
-		kfree(krepl);
+		vfree(krepl);
 		return -ENOMEM;
 	}
 
@@ -2949,8 +2950,8 @@
 		copy_to_user(counters32, krepl->counters, kcountersize))
 			ret = -EFAULT;
 
-	kfree(krepl->counters);
-	kfree(krepl);
+	vfree(krepl->counters);
+	vfree(krepl);
 
 	return ret;
 }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  parent reply	other threads:[~2005-08-22 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20  2:07 2.4 kernels and max # of rules with iptables Jason Wever
2005-06-20  2:20 ` David S. Miller
2005-06-20  2:27 ` Jason Wever
2005-06-22  2:25 ` Jason Wever
2005-08-17 13:06 ` Josh Grebe
2005-08-17 18:33 ` David S. Miller
2005-08-17 18:53 ` Josh Grebe
2005-08-17 18:57 ` David S. Miller
2005-08-22 17:10 ` Gustavo Zacarias [this message]
2005-08-22 17:14 ` David S. Miller
2005-08-22 17:17 ` Gustavo Zacarias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=430A0704.3000501@gentoo.org \
    --to=gustavoz@gentoo.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.