Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47d95045 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: nf_conntrack: fix accounting with fixed timeouts



Don't skip accounting for conntracks with the FIXED_TIMEOUT bit.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d670fdc
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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)) {
@@ -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++;