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);
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to