Skip port accounting when --ports-max is zero.
authorEmil Mikulic <emikulic@gmail.com>
Thu, 1 Jan 2009 12:26:41 +0000 (23:26 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Fri, 24 Apr 2009 11:40:23 +0000 (21:40 +1000)
acct.c

diff --git a/acct.c b/acct.c
index ae9c39d..fb56034 100644 (file)
--- a/acct.c
+++ b/acct.c
@@ -155,6 +155,8 @@ acct_for(const pktsummary *sm)
    pd->in    += sm->len;
    pd->total += sm->len;
 
+   if (ports_max == 0) return; /* skip ports accounting */
+
    /* Ports. */
    switch (sm->proto)
    {