linux/net/batman-adv
Sven Eckelmann 0b8336f5fc batman-adv: Fix gw_bandwidth calculation on 32 bit systems
The TVLV for the gw_bandwidth stores everything as u32. But the
gw_bandwidth reads the signed long which limits the maximum value to
(2 ** 31 - 1) on systems with 4 byte long. Also the input value is always
converted from either Mibit/s or Kibit/s to 100Kibit/s. This reduces the
values even further when the user sets it via the default unit Kibit/s. It
may even cause an integer overflow and end up with a value the user never
intended.

Instead read the values as u64, check for possible overflows, do the unit
adjustments and then reduce the size to u32.

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-25 00:12:22 +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: Remove multiple assignment per line 2015-08-25 00:12:18 +02:00
bitarray.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
bitarray.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
bridge_loop_avoidance.c batman-adv: Remove multiple assignment per line 2015-08-25 00:12:18 +02:00
bridge_loop_avoidance.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
debugfs.c batman-adv: Add required includes to all files 2015-06-07 17:07:19 +02:00
debugfs.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
distributed-arp-table.c batman-adv: Remove multiple assignment per line 2015-08-25 00:12:18 +02:00
distributed-arp-table.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
fragmentation.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +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: Remove multiple assignment per line 2015-08-25 00:12:18 +02:00
gateway_client.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
gateway_common.c batman-adv: Fix gw_bandwidth calculation on 32 bit systems 2015-08-25 00:12:22 +02:00
gateway_common.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +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: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
hash.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
icmp_socket.c batman-adv: Fix kerneldoc over 80 column lines 2015-08-25 00:12:18 +02:00
icmp_socket.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
Kconfig batman-adv: Kconfig, Add missing DEBUG_FS dependency 2015-01-07 22:17:11 +01:00
main.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
main.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
Makefile batman-adv: Makefile, Sort alphabetically 2015-05-29 10:13:36 +02:00
multicast.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
multicast.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
network-coding.c batman-adv: Remove multiple assignment per line 2015-08-25 00:12:18 +02:00
network-coding.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
originator.c batman-adv: convert orig_node->vlan_list to hlist 2015-08-25 00:12:20 +02:00
originator.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
packet.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
routing.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
routing.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
send.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
send.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
soft-interface.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
soft-interface.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
sysfs.c batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
sysfs.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
translation-table.c batman-adv: prevent potential hlist double deletion 2015-08-25 00:12:21 +02:00
translation-table.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
types.h batman-adv: convert orig_node->vlan_list to hlist 2015-08-25 00:12:20 +02:00