aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2012-09-09 16:27:57 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-11-14 15:00:34 -0500
commitd807f2728708c54a1ac1ce04d4549d8eb2b996d2 (patch)
tree69f48c87df4c09ecc1b70c6be73a414eea93822f /net/batman-adv
parent52aebd6a9fe4ad0245a00ef4457425ad83661c90 (diff)
batman-adv: allow bla traffic only after first worker period
When adding a backbone gateway for the first time, it might not yet be known in the backbone, and therefore we should not forward broadcasts yet. This behaviour is the same as when sending a request to another backbone gw because of a CRC mismatch. The backbone gw will operate normal after the next periodic bla work. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index c49cf24ab33d..8cd97d59ee61 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -402,9 +402,14 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
402 batadv_orig_node_free_ref(orig_node); 402 batadv_orig_node_free_ref(orig_node);
403 } 403 }
404 404
405 if (own_backbone) 405 if (own_backbone) {
406 batadv_bla_send_announce(bat_priv, entry); 406 batadv_bla_send_announce(bat_priv, entry);
407 407
408 /* this will be decreased in the worker thread */
409 atomic_inc(&entry->request_sent);
410 atomic_inc(&bat_priv->bla.num_requests);
411 }
412
408 return entry; 413 return entry;
409} 414}
410 415
@@ -1138,6 +1143,19 @@ static void batadv_bla_periodic_work(struct work_struct *work)
1138 backbone_gw->lasttime = jiffies; 1143 backbone_gw->lasttime = jiffies;
1139 1144
1140 batadv_bla_send_announce(bat_priv, backbone_gw); 1145 batadv_bla_send_announce(bat_priv, backbone_gw);
1146
1147 /* request_sent is only set after creation to avoid
1148 * problems when we are not yet known as backbone gw
1149 * in the backbone.
1150 *
1151 * We can reset this now and allow traffic again.
1152 */
1153
1154 if (atomic_read(&backbone_gw->request_sent) == 0)
1155 continue;
1156
1157 atomic_dec(&backbone_gw->bat_priv->bla.num_requests);
1158 atomic_set(&backbone_gw->request_sent, 0);
1141 } 1159 }
1142 rcu_read_unlock(); 1160 rcu_read_unlock();
1143 } 1161 }