diff options
author | maxim <maxim@FreeBSD.org> | 2004-08-29 08:25:02 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2004-08-29 08:25:02 +0000 |
commit | d003e4e10fd36cc26502515efcbc35bf3a02d2e9 (patch) | |
tree | 93ea7fc321e7ed3f7d461dd8d3624e00a028743c /sbin/ipfw | |
parent | e2eb730c5fd72c36207b2d011e3732726d7cb95c (diff) | |
download | FreeBSD-src-d003e4e10fd36cc26502515efcbc35bf3a02d2e9.zip FreeBSD-src-d003e4e10fd36cc26502515efcbc35bf3a02d2e9.tar.gz |
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
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 19223c4..37e3ec3 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); } |