]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[IGMP]: Fix IGMPV3_EXP() normalization bit shift value.
authorDavid L Stevens <dlstevens@us.ibm.com>
Sat, 25 Nov 2006 01:51:50 +0000 (02:51 +0100)
committerAdrian Bunk <bunk@stusta.de>
Sat, 25 Nov 2006 01:51:50 +0000 (02:51 +0100)
The IGMPV3_EXP() macro doesn't correctly shift the normalization bit, so
time-out values are longer than they should be.

Thanks to Dirk Ooms for finding the problem in IGMPv3 - MLDv2 had a
similar problem that was already fixed a year ago. :-(

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
include/linux/igmp.h

index 28f4f3b36950593a5eec787ce7193cb207bf9be8..c8bccd003b61f49d6dfdafae1ea91a6bd23c8dc7 100644 (file)
@@ -191,7 +191,7 @@ struct ip_mc_list
 #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
 #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
        ((value) < (thresh) ? (value) : \
-        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \
+        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
          (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
 
 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)