Skip site navigation (1)Skip section navigation (2)
Date:      Sat,  7 Dec 2002 18:08:30 -0500 (EST)
From:      Dan Pelleg <daniel+bsd@pelleg.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/46080: [PATCH] logamount in ipfw2 does not default to net.inet.ip.fw.verbose_limit
Message-ID:  <20021207230830.7241473F@lank.auton.cs.cmu.edu>

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

>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




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