From owner-freebsd-ipfw Sat Jun 9 4:31:15 2001 Delivered-To: freebsd-ipfw@freebsd.org Received: from info.iet.unipi.it (info.iet.unipi.it [131.114.9.184]) by hub.freebsd.org (Postfix) with ESMTP id 4104537B403 for ; Sat, 9 Jun 2001 04:31:11 -0700 (PDT) (envelope-from luigi@info.iet.unipi.it) Received: (from luigi@localhost) by info.iet.unipi.it (8.9.3/8.9.3) id NAA61182; Sat, 9 Jun 2001 13:27:02 +0200 (CEST) (envelope-from luigi) From: Luigi Rizzo Message-Id: <200106091127.NAA61182@info.iet.unipi.it> Subject: Re: buckets & sysctl In-Reply-To: from Darren Henderson at "Jun 8, 2001 11:55:59 am" To: Darren Henderson Date: Sat, 9 Jun 2001 13:27:02 +0200 (CEST) Cc: freebsd-ipfw@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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