Date: Sat, 9 Jun 2001 13:27:02 +0200 (CEST) From: Luigi Rizzo <luigi@info.iet.unipi.it> To: Darren Henderson <darren@nighttide.net> Cc: freebsd-ipfw@FreeBSD.ORG Subject: Re: buckets & sysctl Message-ID: <200106091127.NAA61182@info.iet.unipi.it> In-Reply-To: <Pine.BSF.4.30.0106081123510.81663-100000@localhost> from Darren Henderson at "Jun 8, 2001 11:55:59 am"
next in thread | previous in thread | raw e-mail | index | archive | help
>
> I can't seem to get the number of buckets ipfw uses to increase.
you are right, there is some bug in the part of code which handles
updates to dyn_buckets.
The actual variable used is curr_dyn_buckets, which in my intentions
should be set to the power of 2 closest to dyn_buckets -- but as
you can see in the code there is no place where the variable is
actually set. This should be done in add_dyn_rule, probably something
like this in /sys/netinet/ip_fw.c
u_int32_t i = dyn_buckets ;
while ( i > 0 && (i & 1) == 0 )
i >>= 1 ;
if (i != 1) /* not a power of 2 */
dyn_buckets = curr_dyn_buckets ; /* reset */
else {
+ curr_dyn_buckets = dyn_buckets ; /* update */
if (ipfw_dyn_v != NULL)
free(ipfw_dyn_v, M_IPFW);
ipfw_dyn_v = malloc(curr_dyn_buckets * sizeof r,
but i want to look at the code a bit more carefully before committing this.
If you want to test this patch, i'd be glad to know how it works
for you.
cheers
luigi
-----------------------------------+-------------------------------------
Luigi RIZZO, luigi@iet.unipi.it . Dip. di Ing. dell'Informazione
http://www.iet.unipi.it/~luigi/ . Universita` di Pisa
TEL/FAX: +39-050-568.533/522 . via Diotisalvi 2, 56126 PISA (Italy)
Mobile +39-347-0373137
-----------------------------------+-------------------------------------
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ipfw" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106091127.NAA61182>
