From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0D803F824B for ; Fri, 26 Jun 2026 16:11:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.160.73.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490290; cv=none; b=u5vevrAu8xGvZ0SsAFPCfyKCDYltfIkQ6wgM6UBWr/zQ/ikeqAQ6FSTgKhgY76OCmJrraoASTp/bCSTQgmlx2vrHbrmqCm5FFmfOFef9TpZP9byxZAxfAHxpzvynaR3o2d/vENhnquOXGCwNz7F7ePso6AbBalFTwgFV80Cx6xs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782490290; c=relaxed/simple; bh=A8u42liaprNP/PhHokMe7if1pI0HdebfXjSWHvPRZ4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J15Tjv0b0fQm/BIHBjw9c9gUvHbUB+V2GC3w41zugV06T8qWrrc6s8e62C+Q+4Z3NdvTvEM19kdZvxSt5qTpZiCNZMIk9QJXQYlRoieGycViEAUlup1Mq+1GeFx9oZUBWojM1pPiUgZ7SJ/i90R7/TFPyXFrayFgqF4I4manqAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org; spf=pass smtp.mailfrom=narfation.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b=RDKOx2y6; arc=none smtp.client-ip=213.160.73.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="RDKOx2y6" Received: by dvalin.narfation.org (Postfix) id 83AA820019; Fri, 26 Jun 2026 16:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1782490287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u7b3U+e08OqxMAcpByoU4I6VVFh5+9DObfIpgMbxK54=; b=RDKOx2y6Z30SLj4aVWoa0ONJG9zDShkVSKpOjf6eeR2ui8607lm6FViruicK1GIzsNrPE9 wSPyELyDRhDiM7YdZu5QTpXjhTLVQZd+OJcp+XzM2dPuNwa/PzRDMTGadLZfmsHxC5hqmb U19aBW8tKLDUug+o1eLVKzgS5w8/1jQ= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann Subject: [PATCH 6.1 07/25] batman-adv: tp_meter: handle seqno wrap-around for fast recovery detection Date: Fri, 26 Jun 2026 18:11:05 +0200 Message-ID: <20260626161123.124273-8-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260626161123.124273-1-sven@narfation.org> References: <20260626161123.124273-1-sven@narfation.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit commit f54c85ed42a1b27a516cf2a4728f5a612b799e07 upstream. 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: 33a3bb4a3345 ("batman-adv: throughput meter implementation") Signed-off-by: Sven Eckelmann --- 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 c79352cfddc4a..089ac7cc9fbeb 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -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 */ -- 2.47.3