All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized
@ 2017-06-01  6:26 Sven Eckelmann
  2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 2/3] alfred: Always initialize orig cache hash pointer Sven Eckelmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sven Eckelmann @ 2017-06-01  6:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

The return value check after the tg_hash_new call must actually check the
return value and not some other datastructure.

Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.c b/server.c
index 1e358cf..9774281 100644
--- a/server.c
+++ b/server.c
@@ -232,7 +232,7 @@ static void update_server_info(struct globals *globals)
 
 	if (strcmp(globals->mesh_iface, "none") != 0) {
 		tg_hash = tg_hash_new(globals->mesh_iface);
-		if (!globals->data_hash) {
+		if (!tg_hash) {
 			fprintf(stderr, "Failed to create translation hash\n");
 			return;
 		}
-- 
2.11.0


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

* [B.A.T.M.A.N.] [PATCH 2/3] alfred: Always initialize orig cache hash pointer
  2017-06-01  6:26 [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Sven Eckelmann
@ 2017-06-01  6:26 ` Sven Eckelmann
  2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 3/3] alfred: Always initialize translation " Sven Eckelmann
  2017-06-01  8:15 ` [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Simon Wunderlich
  2 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2017-06-01  6:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

The initialization of the cache can be disabled when mesh interface is
"none". We must therefore make sure that the remaining code is not
accessing the uninitialized pointer to the originator cache.

Fixes: e50d18c39f92 ("alfred: Cache the TQ values for each originator")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.c b/server.c
index 9774281..e7f691c 100644
--- a/server.c
+++ b/server.c
@@ -224,7 +224,7 @@ static void update_server_info(struct globals *globals)
 	struct interface *interface;
 	struct ether_addr *macaddr;
 	struct hashtable_t *tg_hash;
-	struct hashtable_t *orig_hash;
+	struct hashtable_t *orig_hash = NULL;
 
 	/* TQ is not used for master sync mode */
 	if (globals->opmode == OPMODE_MASTER)
-- 
2.11.0


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

* [B.A.T.M.A.N.] [PATCH 3/3] alfred: Always initialize translation cache hash pointer
  2017-06-01  6:26 [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Sven Eckelmann
  2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 2/3] alfred: Always initialize orig cache hash pointer Sven Eckelmann
@ 2017-06-01  6:26 ` Sven Eckelmann
  2017-06-01  8:15 ` [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Simon Wunderlich
  2 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2017-06-01  6:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

The initialization of the cache can be disabled when mesh interface is
"none". We must therefore make sure that the remaining code is not
accessing the uninitialized pointer to the translation cache.

Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.c b/server.c
index e7f691c..b6f0812 100644
--- a/server.c
+++ b/server.c
@@ -223,7 +223,7 @@ static void update_server_info(struct globals *globals)
 	struct hash_it_t *hashit = NULL;
 	struct interface *interface;
 	struct ether_addr *macaddr;
-	struct hashtable_t *tg_hash;
+	struct hashtable_t *tg_hash = NULL;
 	struct hashtable_t *orig_hash = NULL;
 
 	/* TQ is not used for master sync mode */
-- 
2.11.0


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

* Re: [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized
  2017-06-01  6:26 [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Sven Eckelmann
  2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 2/3] alfred: Always initialize orig cache hash pointer Sven Eckelmann
  2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 3/3] alfred: Always initialize translation " Sven Eckelmann
@ 2017-06-01  8:15 ` Simon Wunderlich
  2017-06-01  8:25   ` Sven Eckelmann
  2 siblings, 1 reply; 5+ messages in thread
From: Simon Wunderlich @ 2017-06-01  8:15 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

Thanks a lot for fixing that thing I missed and the initialization problems. I 
guess this also takes of the covery splats. I've picked all patches as they 
are.

Thanks,
     Simon

On Thursday, June 1, 2017 8:26:30 AM CEST Sven Eckelmann wrote:
> The return value check after the tg_hash_new call must actually check the
> return value and not some other datastructure.
> 
> Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  server.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server.c b/server.c
> index 1e358cf..9774281 100644
> --- a/server.c
> +++ b/server.c
> @@ -232,7 +232,7 @@ static void update_server_info(struct globals *globals)
> 
>  	if (strcmp(globals->mesh_iface, "none") != 0) {
>  		tg_hash = tg_hash_new(globals->mesh_iface);
> -		if (!globals->data_hash) {
> +		if (!tg_hash) {
>  			fprintf(stderr, "Failed to create translation hash\n");
>  			return;
>  		}


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

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

* Re: [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized
  2017-06-01  8:15 ` [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Simon Wunderlich
@ 2017-06-01  8:25   ` Sven Eckelmann
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2017-06-01  8:25 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: b.a.t.m.a.n

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

On Donnerstag, 1. Juni 2017 10:15:20 CEST Simon Wunderlich wrote:
> Thanks a lot for fixing that thing I missed and the initialization problems. I 
> guess this also takes of the covery splats. I've picked all patches as they 
> are.

Can you please also push patches 2 + 3.

Thanks,
	Sven

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

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

end of thread, other threads:[~2017-06-01  8:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  6:26 [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Sven Eckelmann
2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 2/3] alfred: Always initialize orig cache hash pointer Sven Eckelmann
2017-06-01  6:26 ` [B.A.T.M.A.N.] [PATCH 3/3] alfred: Always initialize translation " Sven Eckelmann
2017-06-01  8:15 ` [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized Simon Wunderlich
2017-06-01  8:25   ` Sven Eckelmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.