summaryrefslogtreecommitdiff
path: root/net/batman-adv/gateway_common.c
diff options
context:
space:
mode:
authorAntonio Quartulli <a@unstable.cc>2016-07-03 13:46:33 +0300
committerSimon Wunderlich <sw@simonwunderlich.de>2016-08-09 08:54:29 +0300
commit34d99cfefaac596adfe9b69f5e7c2cd291af2334 (patch)
tree3499da74782f91678e0601f61512e3fbfa05a6f5 /net/batman-adv/gateway_common.c
parent086869438a73d8213a3f945da6679a548badbabc (diff)
downloadlinux-34d99cfefaac596adfe9b69f5e7c2cd291af2334.tar.xz
batman-adv: make GW election code protocol specific
Each routing protocol may have its own specific logic about gateway election which is potentially based on the metric being used. Create two GW specific API functions and move the current election logic in the B.A.T.M.A.N. IV specific code. Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/gateway_common.c')
-rw-r--r--net/batman-adv/gateway_common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index d7bc6a87bcc9..21184810d89f 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -241,10 +241,9 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
batadv_gw_node_update(bat_priv, orig, &gateway);
- /* restart gateway selection if fast or late switching was enabled */
+ /* restart gateway selection */
if ((gateway.bandwidth_down != 0) &&
- (atomic_read(&bat_priv->gw.mode) == BATADV_GW_MODE_CLIENT) &&
- (atomic_read(&bat_priv->gw.sel_class) > 2))
+ (atomic_read(&bat_priv->gw.mode) == BATADV_GW_MODE_CLIENT))
batadv_gw_check_election(bat_priv, orig);
}