]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
batman-adv: tt: don't merge change entries with different VIDs
authorSven Eckelmann <sven@narfation.org>
Sat, 13 Jun 2026 20:56:41 +0000 (22:56 +0200)
committerSven Eckelmann <sven@narfation.org>
Sun, 14 Jun 2026 07:21:17 +0000 (09:21 +0200)
batadv_tt_local_event() merges/cancels events for the same client which
would conflict or be duplicates. The matching of the queued events only
compares the MAC address - the VLAN ID stored in each event is ignored.

If a MAC would now appear on multiple VID, the two ADD change events (for
VID 1 and VID 2) would be merged to a single vid event. The remote can
therefore not calculate the correct TT table and desync. A full translation
table exchange is required to recover from this state.

A check of VID is therefore necessary to avoid such wrong merges/cancels.

Cc: stable@kernel.org
Fixes: c018ad3de61a ("batman-adv: add the VLAN ID attribute to the TT entry")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/translation-table.c

index 8b6c49c32c89270b17376fe578fca31310e6b327..016ad100153bde64079b58b0ba769277110d83dd 100644 (file)
@@ -447,6 +447,9 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv,
                if (!batadv_compare_eth(entry->change.addr, common->addr))
                        continue;
 
+               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