linux/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
..
bat_algo.h batman-adv: Reformat multiline comments to consistent style 2012-06-20 22:15:33 +02:00
bat_iv_ogm.c batman-adv: fix random jitter calculation 2012-12-26 14:13:23 -08:00
bitarray.c batman-adv: Remove extra check in batadv_bit_get_packet 2012-10-29 09:42:34 +01:00
bitarray.h batman-adv: make batadv_test_bit() return 0 or 1 only 2012-09-19 15:49:53 -04:00
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 batman-adv: support array of debugfs general attributes 2012-11-21 12:34:49 +01:00
debugfs.h batman-adv: Remove bat_ prefix from bat_{debugfs, sysfs}.{c, h} 2012-07-01 22:47:22 +02:00
distributed-arp-table.c batman-adv: Add get_ethtool_stats() support for DAT 2012-11-07 20:00:23 +01:00
distributed-arp-table.h batman-adv: Add get_ethtool_stats() support for DAT 2012-11-07 20:00:23 +01:00
gateway_client.c batman-adv: consolidate duplicated primary_if checking code 2012-10-29 09:42:29 +01:00
gateway_client.h batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
gateway_common.c batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
gateway_common.h batman-adv: Prefix gateway enum with BATADV_ 2012-07-01 22:47:18 +02:00
hard-interface.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
hard-interface.h batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
hash.c batman-adv: Remove space before semicolon 2012-07-01 22:47:23 +02:00
hash.h batman-adv: don't rely on positions in struct for hashing 2012-11-14 21:00:32 +01:00
icmp_socket.c batman-adv: Reserve extra bytes in skb for better alignment 2012-11-07 20:00:16 +01:00
icmp_socket.h batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
Kconfig batman-adv: Add function to calculate crc32c for the skb payload 2012-11-21 12:35:41 +01:00
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
Makefile batman-adv: Distributed ARP Table - add compile option 2012-11-07 20:00:22 +01:00
originator.c batman-adv: substitute tt_poss_change with a per-tt_entry flag 2012-11-14 21:00:35 +01:00
originator.h batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
packet.h batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
ring_buffer.c batman-adv: Prefix main defines with BATADV_ 2012-06-28 08:45:05 +02:00
ring_buffer.h batman-adv: Reformat multiline comments to consistent style 2012-06-20 22:15:33 +02:00
routing.c batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
routing.h batman-adv: Prefix types structs with batadv_ 2012-07-01 22:47:21 +02:00
send.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
send.h batman-adv: Add wrapper to look up neighbor and send skb 2012-11-21 12:34:50 +01:00
soft-interface.c batman-adv: use ETH_P_BATMAN 2012-11-30 10:50:22 +01:00
soft-interface.h batman-adv: change interface_rx to get orig node 2012-08-23 14:20:22 +02:00
sysfs.c batman-adv: Remove instant overwritten variable initialization 2012-11-14 21:00:37 +01:00
sysfs.h batman-adv: Remove bat_ prefix from bat_{debugfs, sysfs}.{c, h} 2012-07-01 22:47:22 +02:00
translation-table.c batman-adv: Add wrapper to look up neighbor and send skb 2012-11-21 12:34:50 +01:00
translation-table.h batman-adv: substitute tt_poss_change with a per-tt_entry flag 2012-11-14 21:00:35 +01:00
types.h batman-adv: Fix broadcast duplist for fragmentation 2012-11-21 12:35:45 +01:00
unicast.c batman-adv: Add wrapper to look up neighbor and send skb 2012-11-21 12:34:50 +01:00
unicast.h batman-adv: Distributed ARP Table - create DHT helper functions 2012-11-07 20:00:19 +01:00
vis.c batman-adv: Add wrapper to look up neighbor and send skb 2012-11-21 12:34:50 +01:00
vis.h batman-adv: fix typos in comments 2012-08-23 14:02:45 +02:00