Skip to content

Commit

Permalink
[NETFILTER]: nf_conntrack: fix accounting with fixed timeouts
Browse files Browse the repository at this point in the history
Don't skip accounting for conntracks with the FIXED_TIMEOUT bit.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 1, 2008
1 parent 1d670fd commit 47d9504
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,8 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,
write_lock_bh(&nf_conntrack_lock);

/* Only update if this is not a fixed timeout */
if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
write_unlock_bh(&nf_conntrack_lock);
return;
}
if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status))
goto acct;

/* If not in hash table, timer will not be active yet */
if (!nf_ct_is_confirmed(ct)) {
Expand All @@ -799,6 +797,7 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,
}
}

acct:
#ifdef CONFIG_NF_CT_ACCT
if (do_acct) {
ct->counters[CTINFO2DIR(ctinfo)].packets++;
Expand Down

0 comments on commit 47d9504

Please sign in to comment.