From: Sven Eckelmann batadv_bla_rx() claims an unclaimed client (or a client which migrated to the local node) by calling batadv_handle_claim() with the address of the primary interface as backbone address. batadv_handle_claim() then registers the backbone gateway via batadv_bla_get_backbone_gw() - but always with own_backbone set to false. When no backbone gateway entry for the local node exists yet on this VLAN (for example due to an earlier error), the entry is therefore created like a foreign backbone gateway. No initial announcement is sent and the entry doesn't enter the BATADV_BLA_BACKBONE_GW_UNSYNCED state with the startup grace period (wait_periods and bla.num_requests). The following call of batadv_bla_update_own_backbone_gw() finds the already existing entry and returns early without fixing this up. As a result, the first announcement is delayed by up to one BLA period and multicast traffic is not held back while the local claim table isn't synced yet. Pass the correct own_backbone value to batadv_bla_get_backbone_gw() by checking whether the backbone address is the address of the primary interface. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-dba9d95d-5eeb-40fd-abf4-e054aee1f735 Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/bridge_loop_avoidance.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 68ff2f94cf49..3da070a087da 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -986,18 +986,22 @@ static bool batadv_handle_claim(struct batadv_priv *bat_priv, unsigned short vid) { struct batadv_bla_backbone_gw *backbone_gw; + bool own_backbone; + + own_backbone = batadv_compare_eth(backbone_addr, + primary_if->net_dev->dev_addr); /* register the gateway if not yet available, and add the claim. */ backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid, - false); + own_backbone); if (unlikely(!backbone_gw)) return true; /* this must be a CLAIM frame */ batadv_bla_add_claim(bat_priv, claim_addr, vid, backbone_gw); - if (batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) + if (own_backbone) batadv_bla_send_claim(bat_priv, claim_addr, vid, BATADV_CLAIM_TYPE_CLAIM); -- 2.47.3