提交 198a62dd 编写于 作者: S Sven Eckelmann 提交者: Simon Wunderlich

batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible

The batadv_v_gw_is_eligible function already assumes that orig_node is not
NULL. But batadv_gw_node_get may have failed to find the originator. It
must therefore be checked whether the batadv_gw_node_get failed and not
whether orig_node is NULL to detect this error.

Fixes: 50164d8f ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic")
Signed-off-by: NSven Eckelmann <sven.eckelmann@openmesh.com>
Acked-by: NAntonio Quartulli <a@unstable.cc>
Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
上级 fe77d825
......@@ -814,7 +814,7 @@ static bool batadv_v_gw_is_eligible(struct batadv_priv *bat_priv,
}
orig_gw = batadv_gw_node_get(bat_priv, orig_node);
if (!orig_node)
if (!orig_gw)
goto out;
if (batadv_v_gw_throughput_get(orig_gw, &orig_throughput) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册