b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
@ 2017-11-29  9:50 Sven Eckelmann
  2017-11-29 10:36 ` Antonio Quartulli
  2017-12-01 11:32 ` Sven Eckelmann
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Eckelmann @ 2017-11-29  9:50 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann, Antonio Quartulli

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: 80b2d47be2c7 ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
---
Cc: Antonio Quartulli <a@unstable.cc>
---
 net/batman-adv/bat_v.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 341ceab8338d829d14a48831bef805bb04af0a8f..e0e2bfcd6b3efd73f2567d23ce304951c9e2c3f0 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
  2017-11-29  9:50 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible Sven Eckelmann
@ 2017-11-29 10:36 ` Antonio Quartulli
  2017-12-01 11:32 ` Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2017-11-29 10:36 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking,
	Sven Eckelmann


[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]



On 29/11/17 17:50, Sven Eckelmann wrote:
> 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: 80b2d47be2c7 ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic")
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>

Acked-by: Antonio Quartulli <a@unstable.cc>



-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
  2017-11-29  9:50 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible Sven Eckelmann
  2017-11-29 10:36 ` Antonio Quartulli
@ 2017-12-01 11:32 ` Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2017-12-01 11:32 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

On Mittwoch, 29. November 2017 10:50:42 CET Sven Eckelmann wrote:
> 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: 80b2d47be2c7 ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic")
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
> ---
> Cc: Antonio Quartulli <a@unstable.cc>
> ---
>  net/batman-adv/bat_v.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied in c7380677d616 [1]

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/c7380677d6167f3798d3ea7a4f1a93663f3c7915

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-01 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29  9:50 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible Sven Eckelmann
2017-11-29 10:36 ` Antonio Quartulli
2017-12-01 11:32 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).