Skip port accounting when --ports-max is zero.
[darkstat] / 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)
    {