From owner-freebsd-bugs Sat Dec 7 15:10: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E43037B401 for ; Sat, 7 Dec 2002 15:10:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E85C543EB2 for ; Sat, 7 Dec 2002 15:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB7NA1x3049542 for ; Sat, 7 Dec 2002 15:10:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB7NA1pg049541; Sat, 7 Dec 2002 15:10:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F98D37B401 for ; Sat, 7 Dec 2002 15:08:39 -0800 (PST) Received: from gw.pelleg.org (gw.pelleg.org [205.201.13.235]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BCD043EB2 for ; Sat, 7 Dec 2002 15:08:38 -0800 (PST) (envelope-from dpelleg@cs.cmu.edu) Received: from lank.auton.cs.cmu.edu (lank.wburn [192.168.3.41]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "dpelleg.dsl.telerama.com", Issuer "Dan Pelleg" (verified OK)) by gw.pelleg.org (Postfix) with ESMTP id 0280357F3 for ; Sat, 7 Dec 2002 18:08:32 -0500 (EST) Received: by lank.auton.cs.cmu.edu (Postfix, from userid 7675) id 7241473F; Sat, 7 Dec 2002 18:08:30 -0500 (EST) Message-Id: <20021207230830.7241473F@lank.auton.cs.cmu.edu> Date: Sat, 7 Dec 2002 18:08:30 -0500 (EST) From: Dan Pelleg Reply-To: Dan Pelleg To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/46080: [PATCH] logamount in ipfw2 does not default to net.inet.ip.fw.verbose_limit 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: 46080 >Category: kern >Synopsis: [PATCH] logamount in ipfw2 does not default to net.inet.ip.fw.verbose_limit >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 07 15:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Dan Pelleg >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: FreeBSD l 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Dec 7 17:24:18 EST 2002 d@l:/usr/scratch/obj/usr/src/sys/L i386 >Description: The "log" option in ipfw2 works differently than it does in ipfw. When given no "logamount" argument, then ipfw does as the man page says and sets the limit to the value of net.inet.ip.fw.verbose_limit. On the other hand, ipfw2 sets it to zero (meaning unlimited logging). >How-To-Repeat: ipfw add log ip from any to any >Fix: Under the assumption that the man page is correct, and ipfw2's code is wrong: --- src/sbin/ipfw/ipfw2.c.orig Sat Dec 7 17:51:42 2002 +++ src/sbin/ipfw/ipfw2.c Sat Dec 7 17:56:37 2002 @@ -2632,7 +2632,14 @@ if (c->max_log < 0) errx(EX_DATAERR, "logamount must be positive"); ac--; av++; - } + } else { + size_t len = sizeof(c->max_log); + + if (sysctlbyname("net.inet.ip.fw.verbose_limit", + &c->max_log, &len, NULL, 0) == -1) + errx(1, "sysctlbyname(\"%s\")", + "net.inet.ip.fw.verbose_limit"); + } cmd = next_cmd(cmd); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message