mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-05 06:01:26 +02:00
batman-adv: tp_meter: handle seqno wrap-around for fast recovery detection
commitf54c85ed42upstream. The recover variable and the last_sent sequence number are initialized on purpose as a really high value which will wrap-around after the first 2000 bytes. The fast recovery precondition must therefore not use simple integer comparisons but use helpers which are aware of the sequence number wrap-arounds. Cc: stable@kernel.org Fixes:33a3bb4a33("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6342b1b539
commit
cb01fe90e8
@@ -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 (tp_vars->recover >= recv_ack)
|
||||
if (!batadv_seq_before(tp_vars->recover, recv_ack))
|
||||
goto out;
|
||||
|
||||
/* if this is the third duplicate ACK do Fast Retransmit */
|
||||
|
||||
Reference in New Issue
Block a user