batman-adv: tp_meter: initialize dec_cwnd explicitly

When batadv_tp_update_cwnd() is called, dec_cwnd is increased. But dec_cwnd
is only initialixed (to 0) when a duplicate Ack was received or when cwnd
is below the ss_threshold.

Just initialize the cwnd during the initialization to avoid any potential
access of uninitialized data.

Cc: stable@kernel.org
Fixes: 33a3bb4a33 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
Sven Eckelmann 2026-05-28 21:14:39 +02:00
parent b2b68b32a7
commit febfb1b862
No known key found for this signature in database
GPG Key ID: 4D0F772BD314F5CB

View File

@ -1055,6 +1055,8 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst,
* mesh_interface, hence its MTU
*/
tp_vars->cwnd = BATADV_TP_PLEN * 3;
tp_vars->dec_cwnd = 0;
/* at the beginning initialise the SS threshold to the biggest possible
* window size, hence the AWND size
*/