From: Antonio Quartulli <ordex@autistici.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>,
Simon Wunderlich <siwu@hrz.tu-chemnitz.de>,
Antonio Quartulli <ordex@autistici.org>
Subject: [PATCH 04/11] batman-adv: send announcement when backbone gw is registered
Date: Tue, 13 Nov 2012 10:15:32 +0100 [thread overview]
Message-ID: <1352798139-19458-5-git-send-email-ordex@autistici.org> (raw)
In-Reply-To: <1352798139-19458-1-git-send-email-ordex@autistici.org>
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
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>
---
net/batman-adv/bridge_loop_avoidance.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index decc042..d1a817f 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -366,7 +366,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;
@@ -413,6 +413,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;
}
@@ -428,7 +432,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;
@@ -636,7 +640,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;
@@ -734,7 +739,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;
--
1.8.0
next prev parent reply other threads:[~2012-11-13 9:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 9:15 pull request: batman-adv 2012-11-13 Antonio Quartulli
[not found] ` <1352798139-19458-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
2012-11-13 9:15 ` [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing Antonio Quartulli
2012-11-13 19:24 ` David Miller
2012-11-13 9:15 ` [PATCH 02/11] batman-adv: fix wrong spinlock inline comment Antonio Quartulli
2012-11-13 9:15 ` [PATCH 03/11] batman-adv: prevent using any virtual device created on batman-adv as hard-interface Antonio Quartulli
2012-11-13 9:15 ` Antonio Quartulli [this message]
2012-11-13 9:15 ` [PATCH 05/11] batman-adv: allow bla traffic only after first worker period Antonio Quartulli
2012-11-13 9:15 ` [PATCH 06/11] batman-adv: wait multiple periods before activating bla Antonio Quartulli
2012-11-13 9:15 ` [PATCH 07/11] batman-adv: substitute tt_poss_change with a per-tt_entry flag Antonio Quartulli
2012-11-13 9:15 ` [PATCH 08/11] batman-adv: refactor code to simplify long lines Antonio Quartulli
2012-11-13 9:15 ` [PATCH 09/11] batman-adv: refactor tt_global_del_struct() Antonio Quartulli
2012-11-13 9:15 ` [PATCH 10/11] batman-adv: roaming handling mechanism redesign Antonio Quartulli
2012-11-13 9:15 ` [PATCH 11/11] batman-adv: Remove instant overwritten variable initialization Antonio Quartulli
-- strict thread matches above, loose matches on Subject: below --
2012-11-14 20:16 pull request: batman-adv 2012-11-14 Antonio Quartulli
2012-11-14 20:16 ` [PATCH 04/11] batman-adv: send announcement when backbone gw is registered Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352798139-19458-5-git-send-email-ordex@autistici.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=siwu@hrz.tu-chemnitz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox