Skip to content

Commit 696c4ca

Browse files
ecsvgregkh
authored andcommitted
batman-adv: tp_meter: initialize dup_acks explicitly
commit b2b68b3 upstream. When an ack with a sequence number equal to the last_acked is received, the dup_acks counter is increased to decide whether fast retransmit should be performed. Only when the sequence numbers are not equal, the dup_acks is set to the initial value (0). But if the initial packet would have the sequence number BATADV_TP_FIRST_SEQ, dup_acks would not be initialized and atomic_inc would operate on an undefined starting value. It is therefore required to have it explicitly initialized during the start of the sender session. Cc: stable@kernel.org Fixes: 33a3bb4 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1c5a126 commit 696c4ca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/batman-adv/tp_meter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst,
10451045
tp_vars->icmp_uid = icmp_uid;
10461046

10471047
tp_vars->last_sent = BATADV_TP_FIRST_SEQ;
1048+
atomic_set(&tp_vars->dup_acks, 0);
10481049
atomic_set(&tp_vars->last_acked, BATADV_TP_FIRST_SEQ);
10491050
tp_vars->fast_recovery = false;
10501051
tp_vars->recover = BATADV_TP_FIRST_SEQ;

0 commit comments

Comments
 (0)