Article View: linux.kernel.netdev
Article #8935[PATCH net v2 08/14] batman-adv: tt: only transmit local ROAM flag together with DEL
From: Simon Wunderlich
Date: Fri, 30 Oct 2026 13:50
Date: Fri, 30 Oct 2026 13:50
91 lines
12790 bytes
12790 bytes
From: Sven Eckelmann <sven@narfation.org>
BATADV_TT_CLIENT_ROAM is part of BATADV_TT_REMOTE_MASK but on the wire it
only has a defined meaning together with BATADV_TT_CLIENT_DEL: the
originator no longer serves the client because it roamed to another node.
Such a DEL is only relevant for events (non-full table requests).
An ADD carrying ROAM is processed (by accident) by the receiver like a
ROAMING_ADV: a newly created global entry is marked as roaming and is
excluded from the global CRC. But the sender includes it in its local CRC.
But such a behavior doesn't make sense for non-ROAM_ADV because a new TTVN
is meant as announced commit of the local TT table of a node and should
therefore not be used to create a temporary (roam) global entry in a node.
At the moment, such an ADD with the BATADV_TT_CLIENT_ROAM flag set can
happen due to two mechanisms:
batadv_tt_local_valid() copies all flags of the local entry into a full
table response. It is not synchronized with batadv_tt_local_mark_removed().
An entry which was marked as ROAM|PENDING by a ROAMING_ADV is still part of
the current TTVN and is sent with the ROAM flag set. The receivers then
create a roaming global entry for it and detect a CRC mismatch, which
causes them to request the full table again.
The same can happen for an ADD change which is queued for an entry which
(still) has the ROAM flag set. For example when only the dynamic WIFI or
ISOLA flags were updated.
It is not triggered by batadv_send_other_tt_response() because
batadv_tt_global_valid() is already taking care of filtering out
BATADV_TT_CLIENT_ROAM entries.
For the two problematic announcement mechanism, only send the ROAM flag of
local entries together with a DEL.
This only fixes the ROAM marking of the global entry and the resulting CRC
mismatch. When the requester of the full table is the node which sent the
ROAMING_ADV, the still announced entry will (independent of the ROAM flag)
cause batadv_tt_global_purge_local() to remove the requester's own (new)
local entry for the client. This is not addressed here.
Cc: stable@vger.kernel.org
Fixes: 27b37ebfa2d2 ("batman-adv: correctly pass the client flag on tt_response")
Fixes: 068ee6e204e1 ("batman-adv: roaming handling mechanism redesign")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
net/batman-adv/translation-table.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 3349376a9087d..39b61426f1680 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -643,9 +643,17 @@ static void __batadv_tt_local_event(struct batadv_priv *bat_priv,
ether_addr_copy(tt_change_node->change.addr, common->addr);
tt_change_node->change.vid = htons(common->vid);
- tt_change_node->change.flags = flags;
del_op_requested = flags & BATADV_TT_CLIENT_DEL;
+ /* the ROAM flag is only meaningful for the receiver in combination
+ * with a DEL. An ADD with ROAM would be interpreted as a roaming
+ * advertisement
+ */
+ if (!del_op_requested)
+ flags &= ~BATADV_TT_CLIENT_ROAM;
+
+ tt_change_node->change.flags = flags;
+
/* check for ADD+DEL, DEL+ADD, ADD+ADD or DEL+DEL events */
spin_lock_bh(&bat_priv->tt.changes_list_lock);
changes = READ_ONCE(bat_priv->tt.local_changes);
@@ -3342,8 +3350,12 @@ static bool batadv_tt_local_valid(void *entry_ptr,
if (tt_flags & BATADV_TT_CLIENT_NEW)
return false;
+ /* the entry is (still) announced. A ROAM flag of an entry which is
+ * pending to be removed must not be transmitted. Otherwise, the
+ * receiver would handle it like a roaming advertisement
+ */
if (flags)
- *flags = tt_flags;
+ *flags = tt_flags & ~BATADV_TT_CLIENT_ROAM;
return true;
}
--
2.47.3
Technical Details
Message-ID:
<20261030135105.2555887-9-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-353798-linux-kernel-netdev=dewy.ruReferences:
<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-353798-linux-kernel-netdev=dewy.ru From: sw@simonwunderlich.de (Simon Wunderlich) Newsgroups: linux.kernel.netdev Subject: [PATCH net v2 08/14] batman-adv: tt: only transmit local ROAM flag together with DEL Date: Fri, 30 Oct 2026 14:50:59 +0100 Organization: Usenet Network Message-ID: <20261030135105.2555887-9-sw@simonwunderlich.de> References: <20261030135105.2555887-1-sw@simonwunderlich.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2248502"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:5eaq+h4UbUI9AkwF7KONU0qWJxE= sha256:bWSnXJUH3HIj75nJVzr1QW2adTo6kIkGLUDPLhNPU8Y= sha1:q2icb3WQtlfYtzOVMhc3tOMUUTE= sha256:qRYyBZwVWb9926DyH82bE6n/rqPC9lvpzq5XUhCNu1M= 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 405D6125C97; Fri, 30 Oct 2026 16:55:51 +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 TYfQbyC3Mkhy; Fri, 30 Oct 2026 16:55:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353798-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 6424F125C91; Fri, 30 Oct 2026 16:55:40 +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 271922EB3E; Fri, 30 Oct 2026 13:51:32 +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=1793368291; b=FbfUJ0N42DjYduIBm0ZXwNpW48PcjQl8+KgE7Dbcz4B3PxCH7YKdWeWz8I28oRhqW60T riQ/HUBoNIhRl2odGvJwJNLVTakbAujc/MlmMc47hJMv0zmP0s9WAC1qU5IU/5Rn6X0vE 4C9wFQnQKuGMLPG5u7bIUDkalpqHP4ejBvGSn7XkkydtRIDHLIFA5Vn/S1aeByjZ1tSle /0HHfxnrLPEUWVnU3h2c3Qibeq5osnvOfNjMmdgLLopEHAkBVRu7rDF7A0NBcw+5mcBdK wbBh6aVT+6e90JeqimhjUsWirAi/mj7G7Fy/pjrg77tcQCgsyrR71IKpIiiSPHduLnA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793368291; 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=IstqoNcnpneLs9BaYOUmzIPD9asveYbGZXS1rxaXSUU=; b=MWFA5HK2qABTcVhhz33Up9YWy5heR9iouyhoCfwHbJG/ZyattpzuqA0DgSFx3LUpGJoK ixVWt24HXB2icDFlb7Ze7sjQGpFi0E32+J+WsrwdsfTSR5ILfnpe+b9OyVIzp5hI/xFKl LsFIybLqLuXviAHkyVDLfuxYKRkCLxngvNtw1QM+aZC/BgbC00Izn+RHVCR6i5myJ2RIH p+5MaiuDIgghcN/8qu3yQftHOeY3j89EUpKaAKCKL0McIvSht+KHaqKJ/mMfrRJVp4k/S uZxtpa2hlbi5KAHg/2OTrWhZphK4sJJkH3oExE0eojwg7xF5Ugt82IDe+tuve/eey/w== 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=pHcvedI2; 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 2DC3360A2606; Fri, 30 Oct 2026 13:51:31 +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=pHcvedI2 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=1793368290; b=s++xLNp6e+yyIJVbybBGTKwywjURL2NmKDseWvNl8x3bLIyDOKvE4IuwwkSgNe4ZfvBL 4liBdvaKW5/CP+2bSKTTY2fd61JibDVAoxamsh+pHs049S8m5kTQtzuP+KamPA2DR7nvg JAt68jGTlnMklpe7g9EmSiVdkKSh+J6Np1nK2O10qd1WdnReznY+MNXWMaEhv3Jzvzifj tY8eqG+6FHr74Z2qwb+srMAalx3NCmjC23DaJr0zyqqt97+vAGrsN2iN4AJx9m/Eg6byw okW4mXA8zk2+5aIq0xy5HRurflLusZTrYgbqjuEuVoyoZfYCyuGPVACaGWlSIpvEtGw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793368290; 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=IstqoNcnpneLs9BaYOUmzIPD9asveYbGZXS1rxaXSUU=; b=1Wcjxn+YBUAj1gROSPnSOVsBUkjw4R3PuIwwE4SnviQqMszgjju3AFNf4jaMY+5/wWaj 1hK/zYktrpBJX0MQc2ZSqaSv4jgjE0jexIKRxriS7HvErdL5p6uPeGhch0y7OQ96Zv7E1 8rphmpdc/vzN1Rngr4VPLkhx+cwO687sAPBqlBD0NtKi8gcXjDq1zayThN1GQoU0+7JFk w6AHebZTXF+NUj+VGgo1jRi6jQJJZoWXNtLmlZIsw7nzaakXIEOyCQOp41fD+aoCW//Ok i7MAUfM+/8VcvFD5+UFbUwXj0/z0QQ4UYj9F6YeIZd5g2LHDDGaoep+cpffvHycW9Ww== 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=pHcvedI2; 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 37779606A339; Fri, 30 Oct 2026 13:51:19 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 37779606A339 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 950DAFA272; Fri, 30 Oct 2026 14:51:16 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de; s=09092022; t=1793368276; 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=IstqoNcnpneLs9BaYOUmzIPD9asveYbGZXS1rxaXSUU=; b=pHcvedI2vl/oUlxaGGmP26ilGMqo9kMMCvkP4yLKUm740NJ8fCiz93sCne8Q6AToV12DPm FnnK7C9DCWtWO1vRBgTid/S4W0EPZKo4WguVg4cPYzH1aej0RlfsEnIhnZytKHiXhEZLbW +F81MOQ4eqzCfkmMDJbSEtqOar0ngCZqgXtCLU8Zwdq3tESActzjE5M+sGBxas1Hv3p4vr 4dE8qlXGuIg1XxlhNywy2o7tq+7fwZCkbuqC5ACtBr6ZbrjMgl3/Btdua7RVfA1j1SQFCn hOo/fpmGlJnE1RVuOfnecpClnrqLsLJjQXSCyMu41mtmxGLqxIqU10j2wAFS+w== 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