[PATCH RFC batadv] batman-adv: tp_meter: fix fast recovery precondition

Sven Eckelmann <[email protected]>
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
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.

Fixes: 98d7a766b645 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <[email protected]>
---
Sending as RFC because I haven't actually checked this in detail. See also
https://www.open-mesh.org/issues/436. I will most likely adopt it for
the "batman-adv: tp_meter: post fixes cleanups" patchset when there is some
consensus.
---
 net/batman-adv/tp_meter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index aefe7572..71655afd 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -730,7 +730,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 (recv_ack <= tp_vars->recover)
 			goto out;
 
 		/* if this is the third duplicate ACK do Fast Retransmit */

---
base-commit: 761c9ff88caff7975be7a7f532b16957ecb8a16e
change-id: 20260601-tp-meter-fast-recovery-1c7dd03cc3f2

Best regards,
--  
Sven Eckelmann <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.