summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-08-28 07:20:59 +0000
committergreen <green@FreeBSD.org>1999-08-28 07:20:59 +0000
commit6b6009ffecf6ac596045df26ddab1ca807e856d3 (patch)
tree9247f60a35c0a53e039091212a6b1dc7a4b8c186
parentc4b74a17645de412877876912ccea4ee68573486 (diff)
downloadFreeBSD-src-6b6009ffecf6ac596045df26ddab1ca807e856d3.zip
FreeBSD-src-6b6009ffecf6ac596045df26ddab1ca807e856d3.tar.gz
Also make the "other" packets counter resettable.
-rw-r--r--sys/netinet/ip_fw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 49e03c3..4bfdc8b 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -74,6 +74,8 @@ static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
static int fw_verbose_limit = 0;
#endif
+static u_int64_t counter; /* counter for ipfw_report(NULL...) */
+
#define IPFW_DEFAULT_RULE ((u_int)(u_short)~0)
LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
@@ -300,7 +302,6 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
struct ifnet *rif, struct ifnet *oif)
{
if (ip) {
- static u_int64_t counter;
struct tcphdr *const tcp = (struct tcphdr *) ((u_int32_t *) ip+ ip->ip_hl);
struct udphdr *const udp = (struct udphdr *) ((u_int32_t *) ip+ ip->ip_hl);
struct icmp *const icmp = (struct icmp *) ((u_int32_t *) ip + ip->ip_hl);
@@ -1158,6 +1159,7 @@ resetlog_entry(struct ip_fw *frwl)
if (frwl == 0) {
s = splnet();
+ counter = 0;
for (fcp = LIST_FIRST(&ip_fw_chain); fcp; fcp = LIST_NEXT(fcp, chain))
fcp->rule->fw_loghighest = fcp->rule->fw_pcnt +
fcp->rule->fw_logamount;
OpenPOWER on IntegriCloud