kernel_samsung_a53x/net/batman-adv
Akinobu Mita 681fcbd50c batman-adv: fix random jitter calculation
[ Upstream commit 143cdd8f33909ff5a153e3f02048738c5964ba26 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Carlos Jimenez (JavaShin-X) <javashin1986@gmail.com>
2024-11-19 17:55:48 +01:00
..
bat_algo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_algo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_iv_ogm.c batman-adv: fix random jitter calculation 2024-11-19 17:55:48 +01:00
bat_iv_ogm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v_elp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v_elp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v_ogm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bat_v_ogm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bitarray.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bitarray.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bridge_loop_avoidance.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bridge_loop_avoidance.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
distributed-arp-table.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
distributed-arp-table.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fragmentation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fragmentation.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gateway_client.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gateway_client.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gateway_common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gateway_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hard-interface.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hard-interface.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hash.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
icmp_socket.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
icmp_socket.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
log.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
log.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
multicast.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
multicast.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
network-coding.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
network-coding.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
originator.c batman-adv: Don't accept TT entries for out-of-spec VIDs 2024-11-19 14:19:34 +01:00
originator.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
routing.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
routing.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
send.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
send.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
soft-interface.c net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
soft-interface.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tp_meter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tp_meter.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
translation-table.c batman-adv: Avoid infinite loop trying to resize local TT 2024-11-19 11:32:19 +01:00
translation-table.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tvlv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tvlv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00