On Sun, Oct 27, 2013 at 05:46:13PM +0800, Marek Lindner wrote:
On Saturday 26 October 2013 09:59:03 Antonio Quartulli wrote:
diff --git a/gateway_client.c b/gateway_client.c index 2449afa..2903bdb 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -207,6 +207,10 @@ 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
Right above the batadv_gw_check_client_stop() call in batadv_store_gw_mode() a very similar function is called: batadv_gw_deselect().
Calling batadv_gw_deselect() is not enough to ensure an ADD event is sent ?
no. this function is used in several points and it is just an indicator that tells the GW code to perform a re-election. It does not guarantee that an event is going to be sent (on re-election the same GW could be elected once again..)
In case the old gateway == new gateway we have no event ? If so, that should be documented somehwere ..
did you expect an event in case of (old gw == new gw) ? It's neither an ADD nor a CHANGE nor a DEL...
Cheers,