batman-adv: deselect current GW on client mode switch off

When switching from gw_mode client to either off or server
the current selected gateway has to be deselected.
In this way when client mode is enabled again a gateway
re-election is forced and a GW_ADD event is consequently
sent.

The current behaviour instead is to keep the current gateway
leading to no GW_ADD event when gw_mode client is selected
for a second time

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
This commit is contained in:
Antonio Quartulli
2013-11-04 20:59:40 +01:00
committed by Antonio Quartulli
parent ebf38fb7ab
commit f316318157
2 changed files with 14 additions and 0 deletions

View File

@@ -205,6 +205,11 @@ void batadv_gw_check_client_stop(struct batadv_priv *bat_priv)
if (!curr_gw)
return;
/* deselect the current gateway so that next time that client mode is
* enabled a proper GW_ADD event can be sent
*/
batadv_gw_select(bat_priv, NULL);
/* if batman-adv is switching the gw client mode off and a gateway was
* already selected, send a DEL uevent
*/