diff options
-rw-r--r-- | net/batman-adv/gateway_client.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 0350c0cd690e..6381864c1ca4 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c | |||
@@ -179,6 +179,7 @@ void gw_election(struct bat_priv *bat_priv) | |||
179 | { | 179 | { |
180 | struct gw_node *curr_gw = NULL, *next_gw = NULL; | 180 | struct gw_node *curr_gw = NULL, *next_gw = NULL; |
181 | struct neigh_node *router = NULL; | 181 | struct neigh_node *router = NULL; |
182 | char gw_addr[18] = { '\0' }; | ||
182 | 183 | ||
183 | /** | 184 | /** |
184 | * The batman daemon checks here if we already passed a full originator | 185 | * The batman daemon checks here if we already passed a full originator |
@@ -200,6 +201,8 @@ void gw_election(struct bat_priv *bat_priv) | |||
200 | goto out; | 201 | goto out; |
201 | 202 | ||
202 | if (next_gw) { | 203 | if (next_gw) { |
204 | sprintf(gw_addr, "%pM", next_gw->orig_node->orig); | ||
205 | |||
203 | router = orig_node_get_router(next_gw->orig_node); | 206 | router = orig_node_get_router(next_gw->orig_node); |
204 | if (!router) { | 207 | if (!router) { |
205 | gw_deselect(bat_priv); | 208 | gw_deselect(bat_priv); |
@@ -210,12 +213,14 @@ void gw_election(struct bat_priv *bat_priv) | |||
210 | if ((curr_gw) && (!next_gw)) { | 213 | if ((curr_gw) && (!next_gw)) { |
211 | bat_dbg(DBG_BATMAN, bat_priv, | 214 | bat_dbg(DBG_BATMAN, bat_priv, |
212 | "Removing selected gateway - no gateway in range\n"); | 215 | "Removing selected gateway - no gateway in range\n"); |
216 | throw_uevent(bat_priv, UEV_GW, UEV_DEL, NULL); | ||
213 | } else if ((!curr_gw) && (next_gw)) { | 217 | } else if ((!curr_gw) && (next_gw)) { |
214 | bat_dbg(DBG_BATMAN, bat_priv, | 218 | bat_dbg(DBG_BATMAN, bat_priv, |
215 | "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", | 219 | "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", |
216 | next_gw->orig_node->orig, | 220 | next_gw->orig_node->orig, |
217 | next_gw->orig_node->gw_flags, | 221 | next_gw->orig_node->gw_flags, |
218 | router->tq_avg); | 222 | router->tq_avg); |
223 | throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); | ||
219 | } else { | 224 | } else { |
220 | bat_dbg(DBG_BATMAN, bat_priv, | 225 | bat_dbg(DBG_BATMAN, bat_priv, |
221 | "Changing route to gateway %pM " | 226 | "Changing route to gateway %pM " |
@@ -223,6 +228,7 @@ void gw_election(struct bat_priv *bat_priv) | |||
223 | next_gw->orig_node->orig, | 228 | next_gw->orig_node->orig, |
224 | next_gw->orig_node->gw_flags, | 229 | next_gw->orig_node->gw_flags, |
225 | router->tq_avg); | 230 | router->tq_avg); |
231 | throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); | ||
226 | } | 232 | } |
227 | 233 | ||
228 | gw_select(bat_priv, next_gw); | 234 | gw_select(bat_priv, next_gw); |