summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2012-09-08 18:02:53 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-11-14 21:00:33 +0100
commit52aebd6a9fe4ad0245a00ef4457425ad83661c90 (patch)
tree36192da73fdf0e93cf6a032d1ceb7f2d2ad3594d
parentb7eddd0b3950ea9dc863f1cbfa30d172dbf772f4 (diff)
batman-adv: send announcement when backbone gw is registered
To avoid loops in the startup phase until the first announcement is sent, send an announcement immediately as soon as a backbone gw is added. This may happen due to various reasons, e.g. a packet passes the rx or tx path. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 49c35a60195a..c49cf24ab33d 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -354,7 +354,7 @@ out:
*/
static struct batadv_backbone_gw *
batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
- short vid)
+ short vid, bool own_backbone)
{
struct batadv_backbone_gw *entry;
struct batadv_orig_node *orig_node;
@@ -401,6 +401,10 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
"became a backbone gateway");
batadv_orig_node_free_ref(orig_node);
}
+
+ if (own_backbone)
+ batadv_bla_send_announce(bat_priv, entry);
+
return entry;
}
@@ -416,7 +420,7 @@ batadv_bla_update_own_backbone_gw(struct batadv_priv *bat_priv,
backbone_gw = batadv_bla_get_backbone_gw(bat_priv,
primary_if->net_dev->dev_addr,
- vid);
+ vid, true);
if (unlikely(!backbone_gw))
return;
@@ -624,7 +628,8 @@ static int batadv_handle_announce(struct batadv_priv *bat_priv,
if (memcmp(an_addr, batadv_announce_mac, 4) != 0)
return 0;
- backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid);
+ backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid,
+ false);
if (unlikely(!backbone_gw))
return 1;
@@ -722,7 +727,8 @@ static int batadv_handle_claim(struct batadv_priv *bat_priv,
/* register the gateway if not yet available, and add the claim. */
- backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid);
+ backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, vid,
+ false);
if (unlikely(!backbone_gw))
return 1;