🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8938

[PATCH net v2 12/14] batman-adv: tt: only update flags for TT events

#8938
From: Simon Wunderlich
Date: Fri, 30 Oct 2026 13:51
102 lines
13209 bytes
From: Sven Eckelmann <sven@narfation.org>

In the first implementation of the translation table events, it was only
possible to announce:

* ADD: new locally detected client
* DEL: disappeared local client

If an ADD event was queued and then a DEL event was queued in the same
timeslot, it is valid to destroy both events because nothing actually
changed for remode nodes

But with commit 3c4f7ab60cc2 ("batman-adv: improve the TT component to
support runtime flag changes") and subsequent changes, it could also happen
that there are extra ADD events:

* ADD: _NEW_ locally detected client
* ADD: already existing client with new flags
* DEL: disappeared local client

The first and the last type of event could in theory still be removed
together from the (to be announced) events queue. But if the "update flags"
ADD is dropped together with the DEL, it would still leave global
translation table of a remote node in the incorrect state - believing that
the client didn't disappear.

If a detected client was previously announced, a DEL event must only
overwrite the "update flags" ADD but the DEL itself must still continue to
exist in the (to be anounced) events queue. For now, adjustment of the
announced flags is used for everything instead of dropping already queued
up events completely.

Similarly, a DEL followed by an ADD caused both entries to be deleted. But
the new ADD could announce flags changes which were not yet present for the
client before it was marked for DELetion. The new ADD must therefore only
overwrite the DEL - but still be kept.

Cc: stable@vger.kernel.org
Fixes: 3c4f7ab60cc2 ("batman-adv: improve the TT component to support runtime flag changes")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/translation-table.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 247cce95c09f4..fa5ead248f192 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -622,6 +622,9 @@ static u16 batadv_tt_flags_get(struct batadv_tt_common_entry *common)
  * @bat_priv: the bat priv with all the mesh interface information
  * @common: the TT entry involved in the event
  * @flags: flags of the TT entry combined with the event flags
+ *
+ * Only a single change per client is queued. It describes the latest state of
+ * the client and a new event therefore replaces an already queued one.
  */
 static void __batadv_tt_local_event(struct batadv_priv *bat_priv,
 				    const struct batadv_tt_common_entry *common,
@@ -631,7 +634,6 @@ static void __batadv_tt_local_event(struct batadv_priv *bat_priv,
 	struct batadv_tt_change_node *entry;
 	struct batadv_tt_change_node *safe;
 	bool del_op_requested;
-	bool del_op_entry;
 	size_t changes;
 
 	tt_change_node = kmem_cache_alloc(batadv_tt_change_cache, GFP_ATOMIC);
@@ -665,25 +667,12 @@ static void __batadv_tt_local_event(struct batadv_priv *bat_priv,
 		if (entry->change.vid != tt_change_node->change.vid)
 			continue;
 
-		del_op_entry = entry->change.flags & BATADV_TT_CLIENT_DEL;
-		if (del_op_requested != del_op_entry) {
-			/* DEL+ADD in the same orig interval have no effect and
-			 * can be removed to avoid silly behaviour on the
-			 * receiver side. The  other way around (ADD+DEL) can
-			 * happen in case of roaming of  a client still in the
-			 * NEW state. Roaming of NEW clients is now possible due
-			 * to automatically recognition of "temporary" clients
-			 */
-			list_del(&entry->list);
-			kmem_cache_free(batadv_tt_change_cache, entry);
-			changes--;
-		} else {
-			/* this is a second add or del in the same originator
-			 * interval. It could mean that flags have been changed
-			 * (e.g. double add): update them
-			 */
-			entry->change.flags = flags;
-		}
+		/* the other nodes may know the client with different
+		 * flags. A DEL+ADD must therefore still announce the
+		 * current flags and an ADD+DEL must still remove the
+		 * client. ADD+ADD and DEL+DEL only update the flags
+		 */
+		entry->change.flags = flags;
 
 		kmem_cache_free(batadv_tt_change_cache, tt_change_node);
 		goto update_changes;
-- 
2.47.3
Technical Details
Message-ID: <20261030135105.2555887-13-sw@simonwunderlich.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353793-linux-kernel-netdev=dewy.ru
References: <20261030135105.2555887-1-sw@simonwunderlich.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353793-linux-kernel-netdev=dewy.ru
From: sw@simonwunderlich.de (Simon Wunderlich)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 12/14] batman-adv: tt: only update flags for TT events
Date: Fri, 30 Oct 2026 14:51:03 +0100
Organization: Usenet Network
Message-ID: <20261030135105.2555887-13-sw@simonwunderlich.de>
References: <20261030135105.2555887-1-sw@simonwunderlich.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2248691"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pnCpbLcJHRmr5o29NAF6JxefiYs= sha256:ss8rvuZHUjmYv9el88U56isR6V4m1NoAQ1gfndUVgOg=
	sha1:NsPECeCED9fGzrmUxudqvKQB7vc= sha256:oDE4MQTbKshSeQIS1eybGT/1oac0vsxRXF5CsQfuEBc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id AA5A2125C95; Fri, 30 Oct 2026 16:56:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=simonwunderlich.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 1_jGY7r15JZi;
	Fri, 30 Oct 2026 16:56:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353793-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=simonwunderlich.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 73D72125C91; Fri, 30 Oct 2026 16:56:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 293382FCC3; Fri, 30 Oct 2026 13:51:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793368292;
	b=PxienpG9cFVwUo4DfYL6p5XeC0t2Hy0XYo1A/BNljYzlZ7j7mAHt2WdatUJZZjLbDN7q
	 fTDtKjXO/OWEpXAKK/Zdj6wx/Z0PsbQuuw9qjIFuZQX4QqYRBoyrw/pmZ/sf3YSHO17Xt
	 u8RWNpalB6DErT6wJbBH8HSR4a0WDBM00+kPKcez8iORDKh1noUNArMJezG6ZKAWfu76/
	 ZNOZwX/ZZ1yPlRKsqFAZRS7DpIweHj3KEpM+xT8UjXfoyO0K88mE1Xp+N0Tepe4mpCWOt
	 Ysjh7+6B61d58WIvpOnk2KaVR3C1OsxNzGFMRd2nK2lRcf/e9OoHFktkPXcm8jqMaRQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793368292;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=qAxl1Rkx9/faVoAm4W4hpgsR9FM1HD5z9ExribsXfZc=;
	b=OuWhqvGyB0VBZhVKxDQ1fYfcPryFiIeJG4jAMo4BgDa85300hmOO+YfX8234UQuPjO/J
	 NypbXdVR5TSvv/njI6ecxOWRXg50lio1CCv6BStCupjRks5mom597UwpF95TLTcnk1n3B
	 i4nCQY6F4PnPc943KuxHolrH2EZFVmVsvuG74/GgB1HBbYwtXOd71qhDUXV435+ABBJgz
	 4kyUx1Zfjnt+fbcKwzlXUVOXu8q+CwJHewfaCfzb8KGLx7U8iwV/AmXSVrukcIfnpgkXg
	 gdDxcJxnvPf+qa9UsJWFILhoso5WblWtqQgSRwwuh2yJ+H3CNDKWU70oumB1IGLpUWg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b="rR4//z7F";
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A9346606A32F;
	Fri, 30 Oct 2026 13:51:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=rR4//z7F
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=23.88.38.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793368281;
	b=bsA+w17DtANA0+hMCrWRqZ4TGTP321wuCrJywoKRMwTRShgYYo2NrDyybpRWfOdp1vPO
	 YLSD5dfLwRA8Jy2ASIQ306/vXSZ+jXrU1rPdnZ4dNGTUFnKjicfskhYbQ6xJhJ4Cy36bw
	 a6YBmz9Zkcabfnu/kJ85+S9jd4yX/MaPihh0CA8bEUH1Bi0nLzkTFf+EqB+HPibPmR3zO
	 ASimXkuN0cYaE0BZHmsCV0qyPq0E+yT9cyzeysy4h8BpESiuZtmJHo2U9ksrMA9qM0Nu4
	 ghqg+G7koQMhKy7lnUhq51brpVwJBsiPLv+GSo92Digd6KmZ+4m6HPHFB0wyuWG1SVg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793368281;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=qAxl1Rkx9/faVoAm4W4hpgsR9FM1HD5z9ExribsXfZc=;
	b=3T9G4phLZ2ES4CJ1lTVCmgkwBauPPzL8bclp0UN+tT/18SoJVYWr09jrwJa7hj+bDAST
	 LSenXh+QF7lY4ylIV9Y4YMe4f5XQOjGzJ8rWUzdVCisSlVwjiyGsW8EvKvYzjeletF2cE
	 z+f8C05QfmBw7KKOIq08v7n1jjdJUuGQ2ttJAsRsKMZsZQrJWcA7ThX1qRGxHnlYIcD1G
	 scL12gWKw7dsqg/9XhR5Hw1bvPC3pbSCY+nbwCtrxcQAKt2YJR+/lHFLw8ORJBHPwLnJh
	 Kt2Kq+oLpOewE6Zcf9B1tdyLBSBeh14GvUd/XLprJAUvl56Hsn42uvGUf/xAkARsFTA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=simonwunderlich.de;
	spf=pass smtp.mailfrom=simonwunderlich.de;
	dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b="rR4//z7F";
	arc=none smtp.remote-ip=23.88.38.48
X-Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 32A6A60A2600;
	Fri, 30 Oct 2026 13:51:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 32A6A60A2600
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de
X-Received: from kero.packetmixer.de (p200300c597124Fd839580c360D3ED6F6.dip0.t-ipconnect.de [IPv6:2003:c5:9712:4fd8:3958:c36:d3e:d6f6])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mail.simonwunderlich.de (Postfix) with UTF8SMTPSA id 58B4FFA2EF;
	Fri, 30 Oct 2026 14:51:19 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de;
	s=09092022; t=1793368279;
	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=qAxl1Rkx9/faVoAm4W4hpgsR9FM1HD5z9ExribsXfZc=;
	b=rR4//z7FNrHHklZ+Zy5aTI9Rb01uU5ZHitokftqDYxCrloMILabjrZDF12V2Gp0Wp4tS9Z
	lStFzNcBFRHTcq2xw+NC49tzc12XV4eeYe2aindcw0izN1F5pcr9g69OjMSLX+yc7OhYYm
	a/SUsAAZK2JzJ1MQoPCZUV0RzS0ileHlJXmMGoKbkM0muThFHx/w5ESFTHCWWKEXvDEovP
	C4aRPKnQ06BBGWwf8sxGQrru7M05q17dYxgk0KHyD4yu4VtjIlqk7bdwxDXgp1Z4/z2Btd
	ZUWa4rXRAyZqHdpuSIP4sDDQeOVe/5mcPlu46Xavjc/OmwGW2bHTbOnmYJgBEQ==
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	b.a.t.m.a.n@lists.open-mesh.org,
	Sven Eckelmann <sven@narfation.org>,
	stable@vger.kernel.org,
	Simon Wunderlich <sw@simonwunderlich.de>
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261030135105.2555887-1-sw@simonwunderlich.de>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list