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

Commit a64c3b21 authored by Paras Jain's avatar Paras Jain Committed by Gerrit - the friendly Code Review server
Browse files

QCMAP: Packet counters are not updated in conntrack



Return value of counter api returns s64 instead of u64
Type-casting to the right type.

Change-Id: I8f399ccd52ec4e4f4b23d39f3faa7bb6f23262cc
Acked-by: default avatarVinisha Varre <vvarre@qti.qualcomm.com>
Signed-off-by: default avatarParas Jain <parassin@codeaurora.org>
parent 37a11268
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1888,8 +1888,8 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,
					[CTINFO2DIR(ctinfo)].bytes);

			pkts =
			atomic64_read(&counter[CTINFO2DIR(ctinfo)].packets) +
			atomic64_read(&counter[!CTINFO2DIR(ctinfo)].packets);
			((u64)atomic64_read(&counter[CTINFO2DIR(ctinfo)].packets)) +
			((u64)atomic64_read(&counter[!CTINFO2DIR(ctinfo)].packets));
			/* Report if the packet threshold is reached. */
			if (nf_conntrack_pkt_threshold > 0 &&
			    pkts == nf_conntrack_pkt_threshold) {
+2 −2
Original line number Diff line number Diff line
@@ -245,8 +245,8 @@ dump_counters(struct sk_buff *skb, struct nf_conn_acct *acct,
		pkts = atomic64_xchg(&counter[dir].packets, 0);
		bytes = atomic64_xchg(&counter[dir].bytes, 0);
	} else {
		pkts = atomic64_read(&counter[dir].packets);
		bytes = atomic64_read(&counter[dir].bytes);
		pkts = (u64)atomic64_read(&counter[dir].packets);
		bytes = (u64)atomic64_read(&counter[dir].bytes);
	}

	nest_count = nla_nest_start(skb, attr);