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>
This commit is contained in:

committed by
Simon Wunderlich

parent
086869438a
commit
34d99cfefa
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user