android_kernel_oneplus_msm8998/net/batman-adv
Andreas Pape 2d59be48a9 batman-adv: handle race condition for claims between gateways
[ Upstream commit a3a5129e122709306cfa6409781716c2933df99b ]

Consider the following situation which has been found in a test setup:
Gateway B has claimed client C and gateway A has the same backbone
network as B. C sends a broad- or multicast to B and directly after
this packet decides to send another packet to A due to a better TQ
value. B will forward the broad-/multicast into the backbone as it is
the responsible gw and after that A will claim C as it has been
chosen by C as the best gateway. If it now happens that A claims C
before it has received the broad-/multicast forwarded by B (due to
backbone topology or due to some delay in B when forwarding the
packet) we get a critical situation: in the current code A will
immediately unclaim C when receiving the multicast due to the
roaming client scenario although the position of C has not changed
in the mesh. If this happens the multi-/broadcast forwarded by B
will be sent back into the mesh by A and we have looping packets
until one of the gateways claims C again.
In order to prevent this, unclaiming of a client due to the roaming
client scenario is only done after a certain time is expired after
the last claim of the client. 100 ms are used here, which should be
slow enough for big backbones and slow gateways but fast enough not
to break the roaming client use case.

Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
[sven@narfation.org: fix conflicts with current version]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22 09:23:21 +01: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: rearrange batadv_neigh_node_new() arguments to follow convention 2015-08-27 20:15:32 +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: handle race condition for claims between gateways 2018-03-22 09:23:21 +01: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: fix DAT candidate selection (must use vid) 2016-05-11 11:21:17 +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: Add lockdep_asserts for documented external locks 2015-08-25 00:12:23 +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: fix gateway client style issues 2015-08-27 20:15:32 +02:00
gateway_client.h batman-adv: remove obsolete deleted attribute for gateway node 2015-08-27 20:15:32 +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 lower layer needed_(head|tail)room to own ones 2015-08-27 20:15:34 +02:00
hard-interface.h batman-adv: Drop immediate batadv_hard_iface free function 2016-01-31 11:29:02 -08: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
main.c batman-adv: remove obsolete deleted attribute for gateway node 2015-08-27 20:15:32 +02:00
main.h batman-adv: Start new development cycle 2015-08-27 20:15:33 +02:00
Makefile batman-adv: Makefile, Sort alphabetically 2015-05-29 10:13:36 +02:00
multicast.c batman-adv: Add lockdep_asserts for documented external locks 2015-08-25 00:12:23 +02:00
multicast.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
network-coding.c batman-adv: Avoid recursive call_rcu for batadv_nc_node 2016-01-31 11:29:02 -08:00
network-coding.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
originator.c batman-adv: remove unused callback from batadv_algo_ops struct 2016-10-07 15:23:47 +02:00
originator.h batman-adv: Drop immediate orig_node free function 2016-01-31 11:29:02 -08:00
packet.h batman-adv: Replace C99 int types with kernel type 2015-08-25 00:12:17 +02:00
routing.c batman-adv: Reduce refcnt of removed router when updating route 2016-05-11 11:21:18 +02:00
routing.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
send.c batman-adv: Fix broadcast/ogm queue limit on a removed interface 2016-05-11 11:21: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: Check skb size before using encapsulated ETH+VLAN header 2016-05-11 11:21: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: Check for alloc errors when preparing TT local data 2016-12-15 08:49:23 -08:00
translation-table.h batman-adv: Remove batadv_ types forward declarations 2015-08-25 00:12:20 +02:00
types.h batman-adv: remove unused callback from batadv_algo_ops struct 2016-10-07 15:23:47 +02:00