]> Pileus Git - ~andy/linux/commitdiff
batman-adv: Fix range check for expected packets
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Sun, 30 Oct 2011 15:22:43 +0000 (16:22 +0100)
committerSven Eckelmann <sven@narfation.org>
Sun, 20 Nov 2011 12:08:35 +0000 (13:08 +0100)
The check for new packets in the future used a wrong binary operator,
which makes the check expression always true and accepting too many
packets.

Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/bitarray.c

index 0be9ff346fa047bb0e4380aba74a5a50d5ad113c..9bc63b209b3fd0987c31db60716d70f92cd9e7a5 100644 (file)
@@ -155,7 +155,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
        /* sequence number is much newer, probably missed a lot of packets */
 
        if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE)
-               || (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
+               && (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
                bat_dbg(DBG_BATMAN, bat_priv,
                        "We missed a lot of packets (%i) !\n",
                        seq_num_diff - 1);