public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only
@ 2012-09-23 20:41 Antonio Quartulli
  2012-09-23 20:48 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Antonio Quartulli @ 2012-09-23 20:41 UTC (permalink / raw)
  To: stable; +Cc: b.a.t.m.a.n

From: Linus Lüssing <linus.luessing@web.de>

commit dbd6b11e15a2f96030da17dbeda943a8a98ee990 upstream.

On some architectures test_bit() can return other values than 0 or 1:

With a generic x86 OpenWrt image in a kvm setup (batadv_)test_bit()
frequently returns -1 for me, leading to batadv_iv_ogm_update_seqnos()
wrongly signaling a protected seqno window.

This patch tries to fix this issue by making batadv_test_bit() return 0
or 1 only.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/bitarray.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index 1835c15..7d1840b 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -22,8 +22,9 @@
 #ifndef _NET_BATMAN_ADV_BITARRAY_H_
 #define _NET_BATMAN_ADV_BITARRAY_H_
 
-/* returns true if the corresponding bit in the given seq_bits indicates true
- * and curr_seqno is within range of last_seqno */
+/* Returns 1 if the corresponding bit in the given seq_bits indicates true
+ * and curr_seqno is within range of last_seqno. Otherwise returns 0.
+ */
 static inline int bat_test_bit(const unsigned long *seq_bits,
 			       uint32_t last_seqno, uint32_t curr_seqno)
 {
@@ -33,7 +34,7 @@ static inline int bat_test_bit(const unsigned long *seq_bits,
 	if (diff < 0 || diff >= TQ_LOCAL_WINDOW_SIZE)
 		return 0;
 	else
-		return  test_bit(diff, seq_bits);
+		return test_bit(diff, seq_bits) != 0;
 }
 
 /* turn corresponding bit on, so we can remember that we got the packet */
-- 
1.7.12


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

* Re: [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only
  2012-09-23 20:41 [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only Antonio Quartulli
@ 2012-09-23 20:48 ` David Miller
  2012-09-23 21:20   ` Marek Lindner
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-09-23 20:48 UTC (permalink / raw)
  To: ordex; +Cc: b.a.t.m.a.n, stable


This is not how the make stable submissions for networking changes.

I already have this patch queued up at:

http://patchwork.ozlabs.org/user/bundle/2566/?state=*

When you submit networking fixes incorrectly like this, it make more
work for me and the -stable maintainers.  So please don't do this.

Thanks.

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

* Re: [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only
  2012-09-23 20:48 ` David Miller
@ 2012-09-23 21:20   ` Marek Lindner
  2012-09-23 21:22     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Lindner @ 2012-09-23 21:20 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: David Miller


David,

On Monday, September 24, 2012 04:48:05 David Miller wrote:
> This is not how the make stable submissions for networking changes.
> 
> I already have this patch queued up at:
> 
> http://patchwork.ozlabs.org/user/bundle/2566/?state=*

do you have some kind of "news feed" (website / announce list / blog / twitter 
/ $web2.0 tech / whatever) we can follow to stay informed about policy changes 
regarding the net tree ? At the moment our only method of "informing 
ourselves" consists of bumping into something which we'd like to avoid as much 
as you do.

Thanks,
Marek

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

* Re: [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only
  2012-09-23 21:20   ` Marek Lindner
@ 2012-09-23 21:22     ` David Miller
  2012-09-23 21:42       ` Marek Lindner
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-09-23 21:22 UTC (permalink / raw)
  To: lindner_marek; +Cc: b.a.t.m.a.n

From: Marek Lindner <lindner_marek@yahoo.de>
Date: Mon, 24 Sep 2012 05:20:11 +0800

> On Monday, September 24, 2012 04:48:05 David Miller wrote:
>> This is not how the make stable submissions for networking changes.
>> 
>> I already have this patch queued up at:
>> 
>> http://patchwork.ozlabs.org/user/bundle/2566/?state=*
> 
> do you have some kind of "news feed" (website / announce list / blog / twitter 
> / $web2.0 tech / whatever) we can follow to stay informed about policy changes 
> regarding the net tree ? At the moment our only method of "informing 
> ourselves" consists of bumping into something which we'd like to avoid as much 
> as you do.

No.

Anyone doing networking development should follow the netdev mailing list,
where you can see policy in action and become familiar with the norms
and expectations of the project.

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

* Re: [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only
  2012-09-23 21:22     ` David Miller
@ 2012-09-23 21:42       ` Marek Lindner
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2012-09-23 21:42 UTC (permalink / raw)
  To: David Miller; +Cc: b.a.t.m.a.n

On Monday, September 24, 2012 05:22:24 David Miller wrote:
> > do you have some kind of "news feed" (website / announce list / blog /
> > twitter  / $web2.0 tech / whatever) we can follow to stay informed about
> > policy changes regarding the net tree ? At the moment our only method of
> > "informing ourselves" consists of bumping into something which we'd like
> > to avoid as much as you do.
> 
> No.
> 
> Anyone doing networking development should follow the netdev mailing list,
> where you can see policy in action and become familiar with the norms
> and expectations of the project.

Of course, it is up to you to make that call. Though it might be worth 
considering that a smart information policy might save you some breath in the 
long run. In the current state of affairs creating an extra burden on you is 
hardly avoidable.

Regards,
Marek

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

end of thread, other threads:[~2012-09-23 21:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 20:41 [B.A.T.M.A.N.] [PATCH stable 3.5] batman-adv: make batadv_test_bit() return 0 or 1 only Antonio Quartulli
2012-09-23 20:48 ` David Miller
2012-09-23 21:20   ` Marek Lindner
2012-09-23 21:22     ` David Miller
2012-09-23 21:42       ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox