From owner-freebsd-bugs Tue Sep 4 8:20:16 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CF49837B40C for ; Tue, 4 Sep 2001 08:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f84FK1D39141; Tue, 4 Sep 2001 08:20:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D95E637B405 for ; Tue, 4 Sep 2001 08:12:14 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f84FCEm10320; Tue, 4 Sep 2001 08:12:14 -0700 (PDT) (envelope-from nobody) Message-Id: <200109041512.f84FCEm10320@freefall.freebsd.org> Date: Tue, 4 Sep 2001 08:12:14 -0700 (PDT) From: Christian Wittenhorst To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/30315: ifpw broken: curr_dyn_buckets cannot be changed Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30315 >Category: kern >Synopsis: ifpw broken: curr_dyn_buckets cannot be changed >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 04 08:20:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Christian Wittenhorst >Release: 4.4RC (cvsup'ed from RELENG_4) >Organization: progon network engineering >Environment: FreeBSD odin.progon.net 4.4-RC FreeBSD 4.4-RC #1: Mon Sep 3 09:21:26 GMT 2001 wiwi@odin.progon.net:/usr/src/sys/compile/odin i386 >Description: Bug in: /usr/src/sys/netinet/ip_fw.c "static void add_dyn_rule(struct ipfw_flow_id *id, struct ipfw_flow_id *mask, struct ip_fw_chain *chain)" curr_dyn_buckets will never be updated! There is a statement missing! if (i != 1) /* not a power of 2 */ dyn_buckets = curr_dyn_buckets ; /* reset */ else { ****** ****** the following statement is missing in the original sources! ****** ****** curr_dyn_buckets = dyn_buckets; ****** ****** end of changes ****** ****** if (ipfw_dyn_v != NULL) free(ipfw_dyn_v, M_IPFW); ipfw_dyn_v = malloc(curr_dyn_buckets * sizeof r, M_IPFW, M_DONTWAIT | M_ZERO); if (ipfw_dyn_v == NULL) return ; /* failed ! */ >How-To-Repeat: just try to change the number of buckets for dynamic rules! eg: sysctl -w net.inet.ip.fw.dyn_buckets=8192 the number will never be changed actually... >Fix: insert: curr_dyn_buckets = dyn_buckets; as shown above! >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message