]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
batman-adv: tp_meter: fix fast recovery precondition
authorSven Eckelmann <sven@narfation.org>
Mon, 1 Jun 2026 09:00:23 +0000 (11:00 +0200)
committerSven Eckelmann <sven@narfation.org>
Wed, 3 Jun 2026 06:02:20 +0000 (08:02 +0200)
The fast recovery precondition checks if the recover (initialized to
BATADV_TP_FIRST_SEQ) is bigger than the received ack. But since recover is
only updated when this check is successful, it will never enter the fast
recovery mode.

According to RFC6582 Section 3.2 step 2, the check should actually be
different:

> When the third duplicate ACK is received, the TCP sender first
> checks the value of recover to see if the Cumulative
> Acknowledgment field covers more than recover

The precondition must therefore check if recover is smaller than the
received ack - basically swapping the operands of the current check.

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 1655f181c92937113a118c61c389867ec0d0ca47..ae6acbc60c8ed603389c2aa858b553b2628ce946 100644 (file)
@@ -733,7 +733,7 @@ static void batadv_tp_recv_ack(struct batadv_priv *bat_priv,
                if (atomic_read(&tp_vars->dup_acks) != 3)
                        goto out;
 
-               if (recv_ack >= tp_vars->recover)
+               if (tp_vars->recover >= recv_ack)
                        goto out;
 
                /* if this is the third duplicate ACK do Fast Retransmit */