提交 d807f272 编写于 作者: S Simon Wunderlich 提交者: Antonio Quartulli

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: NSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: NAntonio Quartulli <ordex@autistici.org>
上级 52aebd6a
无相关合并请求
......@@ -402,9 +402,14 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
batadv_orig_node_free_ref(orig_node);
}
if (own_backbone)
if (own_backbone) {
batadv_bla_send_announce(bat_priv, entry);
/* this will be decreased in the worker thread */
atomic_inc(&entry->request_sent);
atomic_inc(&bat_priv->bla.num_requests);
}
return entry;
}
......@@ -1138,6 +1143,19 @@ static void batadv_bla_periodic_work(struct work_struct *work)
backbone_gw->lasttime = jiffies;
batadv_bla_send_announce(bat_priv, backbone_gw);
/* request_sent is only set after creation to avoid
* problems when we are not yet known as backbone gw
* in the backbone.
*
* We can reset this now and allow traffic again.
*/
if (atomic_read(&backbone_gw->request_sent) == 0)
continue;
atomic_dec(&backbone_gw->bat_priv->bla.num_requests);
atomic_set(&backbone_gw->request_sent, 0);
}
rcu_read_unlock();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部