]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
batman-adv: tp_meter: initialize dec_cwnd explicitly
authorSven Eckelmann <sven@narfation.org>
Thu, 28 May 2026 19:14:39 +0000 (21:14 +0200)
committerSven Eckelmann <sven@narfation.org>
Wed, 3 Jun 2026 06:02:19 +0000 (08:02 +0200)
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: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/tp_meter.c

index 8d7308327a9bfa28a7aef536a1e6655656254ae9..beabc264a4f16b8798d5353c89b98aeaa01037b4 100644 (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
         */