From 9ec4f2e1b3153cf12806e9ffea6012253c6e4180 Mon Sep 17 00:00:00 2001 From: Maxim Konovalov Date: Sun, 29 Aug 2004 08:25:02 +0000 Subject: [PATCH] o Restore a historical ipfw1 logamount behaviour: rules with 'log' keyword but without 'logamount' limit the amount of their log messages by net.inet.ip.fw.verbose_limit sysctl value. RELENG_5 candidate. PR: kern/46080 Submitted by: Dan Pelleg MFC after: 1 week --- sbin/ipfw/ipfw2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 19223c440e33..37e3ec377130 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2781,6 +2781,7 @@ add(int ac, char *av[]) * various flags used to record that we entered some fields. */ ipfw_insn *have_state = NULL; /* check-state or keep-state */ + size_t len; int i; @@ -2962,6 +2963,12 @@ add(int ac, char *av[]) errx(EX_DATAERR, "logamount must be positive"); c->max_log = l; ac--; av++; + } else { + 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); }