]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
batman-adv: tt: avoid request storms during pending request
authorSven Eckelmann <sven@narfation.org>
Thu, 2 Jul 2026 19:06:23 +0000 (21:06 +0200)
committerSven Eckelmann <sven@narfation.org>
Mon, 6 Jul 2026 05:18:58 +0000 (07:18 +0200)
batadv_send_tt_request() allocates a tt_req_node when none exists for the
destination originator node. This should prevent that a multiple TT
requests are send at the same time to an originator.

But if allocation of the send buffer failed, this request must be cleaned
up again. But indicator for such a failure is "ret == false". But the
actual implementation is checking for "ret == true".

The check must be inverted to not loose the information about the TT
request directly after it was attempted to be sent out. This should avoid
potential request storms.

Cc: stable@vger.kernel.org
Fixes: 335fbe0f5d25 ("batman-adv: tvlv - convert tt query packet to use tvlv unicast packets")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/translation-table.c

index 4bfad36a4b7043b1a1e24ec4118c0e65edf8c2b8..aae72015645a467144c3f9136fbbbdd686e1b08b 100644 (file)
@@ -2971,7 +2971,7 @@ static bool batadv_send_tt_request(struct batadv_priv *bat_priv,
 out:
        batadv_hardif_put(primary_if);
 
-       if (ret && tt_req_node) {
+       if (!ret && tt_req_node) {
                spin_lock_bh(&bat_priv->tt.req_list_lock);
                if (!hlist_unhashed(&tt_req_node->list)) {
                        hlist_del_init(&tt_req_node->list);