Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2001 08:12:14 -0700 (PDT)
From:      Christian Wittenhorst <wiwi@progon.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/30315: ifpw broken: curr_dyn_buckets cannot be changed
Message-ID:  <200109041512.f84FCEm10320@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help


>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109041512.f84FCEm10320>