diff options
author | luigi <luigi@FreeBSD.org> | 2009-02-16 12:09:52 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2009-02-16 12:09:52 +0000 |
commit | e8429cbcf1522572a911b7c5ab5378c88af3a105 (patch) | |
tree | d2df0cd209cdcd7a9f2319afd799b22846a97c55 /sys/netinet | |
parent | 8ad13431e15ea846407c248a6dff6d18de24d61b (diff) | |
download | FreeBSD-src-e8429cbcf1522572a911b7c5ab5378c88af3a105.zip FreeBSD-src-e8429cbcf1522572a911b7c5ab5378c88af3a105.tar.gz |
use a const format string in the log message so we can check the
arguments (if/when we enable those checks)
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_fw2.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 46364b7..1c19f8d 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -3762,8 +3762,8 @@ zero_entry(struct ip_fw_chain *chain, u_int32_t arg, int log_only) continue; clear_counters(rule, log_only); } - msg = log_only ? "ipfw: All logging counts reset.\n" : - "ipfw: Accounting cleared.\n"; + msg = log_only ? "All logging counts reset" : + "Accounting cleared"; } else { int cleared = 0; /* @@ -3784,13 +3784,18 @@ zero_entry(struct ip_fw_chain *chain, u_int32_t arg, int log_only) IPFW_WUNLOCK(chain); return (EINVAL); } - msg = log_only ? "ipfw: Entry %d logging count reset.\n" : - "ipfw: Entry %d cleared.\n"; + msg = log_only ? "logging count reset" : "cleared"; } IPFW_WUNLOCK(chain); - if (V_fw_verbose) - log(LOG_SECURITY | LOG_NOTICE, msg, rulenum); + if (V_fw_verbose) { + int lev = LOG_SECURITY | LOG_NOTICE; + + if (rulenum) + log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); + else + log(lev, "ipfw: %s.\n", msg); + } return (0); } |