batman-adv: Ensure that we really have route changes in update_route
authorSven Eckelmann <sven@narfation.org>
Tue, 10 May 2011 09:22:37 +0000 (11:22 +0200)
committerSven Eckelmann <sven@narfation.org>
Mon, 30 May 2011 05:39:37 +0000 (07:39 +0200)
The debug output of update_route has tests for "route deleted" and "route
added". All other situations are handled as "route changed". This is not
true because neigh_node and curr_router could be both NULL.

The function is not called in this situation, but the code might be
interpreted wrong when reading it without this test.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/routing.c

index 90ae6f0c30f325fbf849971df9869ea6b0dc02e1..368ceeba8145db20415923da2e18cd942b73d143 100644 (file)
@@ -108,7 +108,7 @@ static void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
                                    tt_buff, tt_buff_len);
 
        /* route changed */
-       } else {
+       } else if (neigh_node && curr_router) {
                bat_dbg(DBG_ROUTES, bat_priv,
                        "Changing route towards: %pM "
                        "(now via %pM - was via %pM)\n",