Skip to content

Commit

Permalink
batman-adv: use orig_hash_find() instead of get_orig_node() in TT code
Browse files Browse the repository at this point in the history
get_orig_node() tries to retrieve an orig_node object based on a mac address
and creates it if not present. This is not the wanted behaviour in the
translation table code as we don't want to create new orig_code objects but
expect a NULL pointer if the object does not exist.

Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
  • Loading branch information
Antonio Quartulli authored and Sven Eckelmann committed Nov 20, 2011
1 parent be7af5c commit eb7e2a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,11 +1188,11 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));

/* Let's get the orig node of the REAL destination */
req_dst_orig_node = get_orig_node(bat_priv, tt_request->dst);
req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst);
if (!req_dst_orig_node)
goto out;

res_dst_orig_node = get_orig_node(bat_priv, tt_request->src);
res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!res_dst_orig_node)
goto out;

Expand Down Expand Up @@ -1318,7 +1318,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
req_ttvn = tt_request->ttvn;

orig_node = get_orig_node(bat_priv, tt_request->src);
orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!orig_node)
goto out;

Expand Down

0 comments on commit eb7e2a1

Please sign in to comment.