diff options
| author | Sven Eckelmann <sven@narfation.org> | 2026-06-26 18:11:16 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-04 13:42:23 +0200 |
| commit | 0c610db91bbdef4c115a8743a9ed82d59686c1ee (patch) | |
| tree | 25ca5128711e1fbf83a82fc29d8e6a81d7afc1d5 | |
| parent | edae04afb11f6a1213033bcdcdfea93870c91619 (diff) | |
| download | linux-stable-0c610db91bbdef4c115a8743a9ed82d59686c1ee.tar.gz linux-stable-0c610db91bbdef4c115a8743a9ed82d59686c1ee.zip | |
batman-adv: tp_meter: initialize dup_acks explicitly
commit b2b68b32a715e0328662801576974aa37b942b00 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: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | net/batman-adv/tp_meter.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index f350a60e6c76..750e5e9d3dc9 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1045,6 +1045,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, tp_vars->icmp_uid = icmp_uid; tp_vars->last_sent = BATADV_TP_FIRST_SEQ; + atomic_set(&tp_vars->dup_acks, 0); atomic_set(&tp_vars->last_acked, BATADV_TP_FIRST_SEQ); tp_vars->fast_recovery = false; tp_vars->recover = BATADV_TP_FIRST_SEQ; |
