diff options
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/gateway_client.c | 5 | ||||
-rw-r--r-- | net/batman-adv/sysfs.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 356417379e96..53a900952282 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -205,6 +205,11 @@ void batadv_gw_check_client_stop(struct batadv_priv *bat_priv) | |||
205 | if (!curr_gw) | 205 | if (!curr_gw) |
206 | return; | 206 | return; |
207 | 207 | ||
208 | /* deselect the current gateway so that next time that client mode is | ||
209 | * enabled a proper GW_ADD event can be sent | ||
210 | */ | ||
211 | batadv_gw_select(bat_priv, NULL); | ||
212 | |||
208 | /* if batman-adv is switching the gw client mode off and a gateway was | 213 | /* if batman-adv is switching the gw client mode off and a gateway was |
209 | * already selected, send a DEL uevent | 214 | * already selected, send a DEL uevent |
210 | */ | 215 | */ |
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c index e28f95183a8b..b652a5648ed3 100644 --- a/net/batman-adv/sysfs.c +++ b/net/batman-adv/sysfs.c | |||
@@ -406,6 +406,15 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj, | |||
406 | batadv_info(net_dev, "Changing gw mode from: %s to: %s\n", | 406 | batadv_info(net_dev, "Changing gw mode from: %s to: %s\n", |
407 | curr_gw_mode_str, buff); | 407 | curr_gw_mode_str, buff); |
408 | 408 | ||
409 | /* Invoking batadv_gw_reselect() is not enough to really de-select the | ||
410 | * current GW. It will only instruct the gateway client code to perform | ||
411 | * a re-election the next time that this is needed. | ||
412 | * | ||
413 | * When gw client mode is being switched off the current GW must be | ||
414 | * de-selected explicitly otherwise no GW_ADD uevent is thrown on | ||
415 | * client mode re-activation. This is operation is performed in | ||
416 | * batadv_gw_check_client_stop(). | ||
417 | */ | ||
409 | batadv_gw_deselect(bat_priv); | 418 | batadv_gw_deselect(bat_priv); |
410 | /* always call batadv_gw_check_client_stop() before changing the gateway | 419 | /* always call batadv_gw_check_client_stop() before changing the gateway |
411 | * state | 420 | * state |