Date: Mon, 16 Feb 2009 12:09:52 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188669 - head/sys/netinet Message-ID: <200902161209.n1GC9rb0056033@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Mon Feb 16 12:09:52 2009 New Revision: 188669 URL: http://svn.freebsd.org/changeset/base/188669 Log: use a const format string in the log message so we can check the arguments (if/when we enable those checks) Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Mon Feb 16 10:29:03 2009 (r188668) +++ head/sys/netinet/ip_fw2.c Mon Feb 16 12:09:52 2009 (r188669) @@ -3762,8 +3762,8 @@ zero_entry(struct ip_fw_chain *chain, u_ 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_ 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902161209.n1GC9rb0056033>