All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure
@ 2012-08-10 21:09 Antonio Quartulli
  2012-08-11  8:58 ` Sven Eckelmann
  2012-08-11  9:11 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
  0 siblings, 2 replies; 5+ messages in thread
From: Antonio Quartulli @ 2012-08-10 21:09 UTC (permalink / raw)
  To: b.a.t.m.a.n

In case of hash_add failure tt_global_add() must return 0 (which means on entry
insertion).

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

This patch is based on master. This bug exists since "a bit" but nobody actually
found it because this bug should have been triggered in the unlikely case of hash
adding failure. Therefore I do not think it is a crucial bug and it is not worth
sending this patch to stable.

Cheers,


 Makefile            |    2 +-
 translation-table.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bd8d30c..12aebe5 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@
 
 # changing the CONFIG_* line to 'y' enables the related feature
 # B.A.T.M.A.N. debugging:
-export CONFIG_BATMAN_ADV_DEBUG=n
+export CONFIG_BATMAN_ADV_DEBUG=y
 # B.A.T.M.A.N. bridge loop avoidance:
 export CONFIG_BATMAN_ADV_BLA=y
 
diff --git a/translation-table.c b/translation-table.c
index 112edd3..eb352db 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -788,13 +788,13 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
 	batadv_dbg(BATADV_DBG_TT, bat_priv,
 		   "Creating new global tt entry: %pM (via %pM)\n",
 		   tt_global_entry->common.addr, orig_node->orig);
+	ret = 1;
 
 out_remove:
 	/* remove address from local hash if present */
 	batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
 			       "global tt received",
 			       flags & BATADV_TT_CLIENT_ROAM);
-	ret = 1;
 out:
 	if (tt_global_entry)
 		batadv_tt_global_entry_free_ref(tt_global_entry);
-- 
1.7.9.4


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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure
  2012-08-10 21:09 [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure Antonio Quartulli
@ 2012-08-11  8:58 ` Sven Eckelmann
  2012-08-11  8:59   ` Antonio Quartulli
  2012-08-11  9:11 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
  1 sibling, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2012-08-11  8:58 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Fri, Aug 10, 2012 at 11:09:26PM +0200, Antonio Quartulli wrote:
> In case of hash_add failure tt_global_add() must return 0 (which means on entry
> insertion).
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
> 
> This patch is based on master. This bug exists since "a bit" but nobody actually
> found it because this bug should have been triggered in the unlikely case of hash
> adding failure. Therefore I do not think it is a crucial bug and it is not worth
> sending this patch to stable.
> 
> Cheers,
> 
> 
>  Makefile            |    2 +-
>  translation-table.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index bd8d30c..12aebe5 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -20,7 +20,7 @@
>  
>  # changing the CONFIG_* line to 'y' enables the related feature
>  # B.A.T.M.A.N. debugging:
> -export CONFIG_BATMAN_ADV_DEBUG=n
> +export CONFIG_BATMAN_ADV_DEBUG=y
>  # B.A.T.M.A.N. bridge loop avoidance:
>  export CONFIG_BATMAN_ADV_BLA=y

Sry, but disapproved.

Kind regards,
	Sven

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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure
  2012-08-11  8:58 ` Sven Eckelmann
@ 2012-08-11  8:59   ` Antonio Quartulli
  0 siblings, 0 replies; 5+ messages in thread
From: Antonio Quartulli @ 2012-08-11  8:59 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

On Sat, Aug 11, 2012 at 10:58:12AM +0200, Sven Eckelmann wrote:
> Sry, but disapproved.


Thank you Sven. Too lazy to add files to the commit and I typed "git commit -a".
Sorry for wasting time/resources.

Will send v2.

Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* [B.A.T.M.A.N.] [PATCHv2] batman-adv: return proper value in case of hash_add failure
  2012-08-10 21:09 [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure Antonio Quartulli
  2012-08-11  8:58 ` Sven Eckelmann
@ 2012-08-11  9:11 ` Antonio Quartulli
  2012-08-22  0:28   ` Marek Lindner
  1 sibling, 1 reply; 5+ messages in thread
From: Antonio Quartulli @ 2012-08-11  9:11 UTC (permalink / raw)
  To: b.a.t.m.a.n

In case of hash_add failure tt_global_add() must return 0 (which means on entry
insertion).

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---

This patch is based on master. This bug exists since "a bit" but nobody actually
found it because this bug should have been triggered in the unlikely case of
hash
adding failure. Therefore I do not think it is a crucial bug and it is not worth
sending this patch to stable.

Cheers,


 translation-table.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/translation-table.c b/translation-table.c
index 112edd3..eb352db 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -788,13 +788,13 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
 	batadv_dbg(BATADV_DBG_TT, bat_priv,
 		   "Creating new global tt entry: %pM (via %pM)\n",
 		   tt_global_entry->common.addr, orig_node->orig);
+	ret = 1;
 
 out_remove:
 	/* remove address from local hash if present */
 	batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
 			       "global tt received",
 			       flags & BATADV_TT_CLIENT_ROAM);
-	ret = 1;
 out:
 	if (tt_global_entry)
 		batadv_tt_global_entry_free_ref(tt_global_entry);
-- 
1.7.9.4


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

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: return proper value in case of hash_add failure
  2012-08-11  9:11 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
@ 2012-08-22  0:28   ` Marek Lindner
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2012-08-22  0:28 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Saturday, August 11, 2012 11:11:00 Antonio Quartulli wrote:
> In case of hash_add failure tt_global_add() must return 0 (which means on
> entry insertion).
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
> 
> This patch is based on master. This bug exists since "a bit" but nobody
> actually found it because this bug should have been triggered in the
> unlikely case of hash
> adding failure. Therefore I do not think it is a crucial bug and it is not
> worth sending this patch to stable.
> 
> Cheers,
> 
> 
>  translation-table.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied in revision 956c0b8.

Thanks,
Marek

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

end of thread, other threads:[~2012-08-22  0:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10 21:09 [B.A.T.M.A.N.] [PATCH] batman-adv: return proper value in case of hash_add failure Antonio Quartulli
2012-08-11  8:58 ` Sven Eckelmann
2012-08-11  8:59   ` Antonio Quartulli
2012-08-11  9:11 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
2012-08-22  0:28   ` Marek Lindner

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.