linux/net/batman-adv
Ruben Wisniewski 571a963768 batman-adv: Avoid u32 overflow during gateway select
The gateway selection based on fast connections is using a single value
calculated from the average tq (0-255) and the download bandwidth (in
100Kibit). The formula for the first step (tq ** 2 * 10000 * bandwidth)
tends to overflow a u32 with low bandwidth settings like 50 [100KiBit]
and a tq value of over 92.

Changing this to a 64 bit unsigned integer allows to support a
bandwidth_down with up to ~2.8e10 [100KiBit] and a perfect tq of 255. This
is ~6.6 times higher than the maximum possible value of the gateway
announcement TVLV.

This problem only affects the non-default gw_sel_class 1.

Signed-off-by: Ruben Wisniewsi <ruben@vfn-nrw.de>
[sven@narfation.org: rewritten commit message]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
2015-08-11 18:10:04 +02:00
..
bat_algo.h batman-adv: update copyright years for 2015 2015-05-29 10:13:35 +02:00
bat_iv_ogm.c batman-adv: Clarify calculation precedence for '&' and '?' 2015-06-07 17:07:19 +02:00
bitarray.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bitarray.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bridge_loop_avoidance.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
bridge_loop_avoidance.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
debugfs.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
debugfs.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
distributed-arp-table.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
distributed-arp-table.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
fragmentation.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
fragmentation.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_client.c batman-adv: Avoid u32 overflow during gateway select 2015-08-11 18:10:04 +02:00
gateway_client.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_common.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
gateway_common.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hard-interface.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hard-interface.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hash.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
hash.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
icmp_socket.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
icmp_socket.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
Kconfig batman-adv: Kconfig, Add missing DEBUG_FS dependency 2015-01-07 22:17:11 +01:00
main.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
main.h batman-adv: Clarify calculation precedence for '&' and '?' 2015-06-07 17:07:19 +02:00
Makefile batman-adv: Makefile, Sort alphabetically 2015-05-29 10:13:36 +02:00
multicast.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
multicast.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
network-coding.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
network-coding.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
originator.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
originator.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
packet.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
routing.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
routing.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
send.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
send.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
soft-interface.c batman-adv: change the MAC of each VLAN upon ndo_set_mac_address 2015-06-07 17:07:20 +02:00
soft-interface.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
sysfs.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
sysfs.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
translation-table.c batman-adv: Clarify calculation precedence for '&' and '?' 2015-06-07 17:07:19 +02:00
translation-table.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
types.h batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00