batman-adv: add basic bridge loop avoidance code
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Sun, 22 Jan 2012 19:00:19 +0000 (20:00 +0100)
committerAntonio Quartulli <ordex@autistici.org>
Wed, 11 Apr 2012 12:28:58 +0000 (14:28 +0200)
commit23721387c409087fd3b97e274f34d3ddc0970b74
treecf386c6f169a1b2b6e8c8ef77be5226e10046689
parenta7f6ee9493677ba40625d810258de5bd521cc1b0
batman-adv: add basic bridge loop avoidance code

This second version of the bridge loop avoidance for batman-adv
avoids loops between the mesh and a backbone (usually a LAN).

By connecting multiple batman-adv mesh nodes to the same ethernet
segment a loop can be created when the soft-interface is bridged
into that ethernet segment. A simple visualization of the loop
involving the most common case - a LAN as ethernet segment:

node1  <-- LAN  -->  node2
  |                   |
wifi   <-- mesh -->  wifi

Packets from the LAN (e.g. ARP broadcasts) will circle forever from
node1 or node2 over the mesh back into the LAN.

With this patch, batman recognizes backbone gateways, nodes which are
part of the mesh and backbone/LAN at the same time. Each backbone
gateway "claims" clients from within the mesh to handle them
exclusively. By restricting that only responsible backbone gateways
may handle their claimed clients traffic, loops are effectively
avoided.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
14 files changed:
Documentation/networking/batman-adv.txt
net/batman-adv/Kconfig
net/batman-adv/Makefile
net/batman-adv/bat_sysfs.c
net/batman-adv/bridge_loop_avoidance.c [new file with mode: 0644]
net/batman-adv/bridge_loop_avoidance.h [new file with mode: 0644]
net/batman-adv/hard-interface.c
net/batman-adv/main.c
net/batman-adv/main.h
net/batman-adv/originator.c
net/batman-adv/packet.h
net/batman-adv/routing.c
net/batman-adv/soft-interface.c
net/batman-adv/types.h