dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/net/batman-adv
Akinobu Mita 143cdd8f33 batman-adv: fix random jitter calculation
batadv_iv_ogm_emit_send_time() attempts to calculates a random integer
in the range of 'orig_interval +- BATADV_JITTER' by the below lines.

        msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
        msecs += (random32() % 2 * BATADV_JITTER);

But it actually gets 'orig_interval' or 'orig_interval - BATADV_JITTER'
because '%' and '*' have same precedence and associativity is
left-to-right.

This adds the parentheses at the appropriate position so that it matches
original intension.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: Antonio Quartulli <ordex@autistici.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-12-26 14:13:23 -08:00
..
Kconfig batman-adv: Add function to calculate crc32c for the skb payload 2012-11-21 12:35:41 +01:00
Makefile
bat_algo.h
bat_iv_ogm.c batman-adv: fix random jitter calculation 2012-12-26 14:13:23 -08:00
bitarray.c
bitarray.h
bridge_loop_avoidance.c batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
bridge_loop_avoidance.h batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
debugfs.c
debugfs.h
distributed-arp-table.c
distributed-arp-table.h
gateway_client.c
gateway_client.h
gateway_common.c
gateway_common.h
hard-interface.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
hard-interface.h
hash.c
hash.h
icmp_socket.c
icmp_socket.h
main.c batman-adv: Add function to calculate crc32c for the skb payload 2012-11-21 12:35:41 +01:00
main.h batman-adv: Start new development cycle 2012-11-21 12:35:46 +01:00
originator.c
originator.h
packet.h batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
ring_buffer.c
ring_buffer.h
routing.c batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
routing.h
send.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
send.h
soft-interface.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
soft-interface.h
sysfs.c
sysfs.h
translation-table.c
translation-table.h
types.h batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
unicast.c
unicast.h
vis.c
vis.h