Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
commit 3dafbb14e5306abf23e791c750f273b05749600f Author: Sven Eckelmann sven@open-mesh.com Date: Tue Jan 19 12:47:07 2016 +0100
openwrt-feed-batman-adv: Allow to select routing algorithm
The network config section for proto batadv now allows to select the routing algorithm via the option routing_algo. This allows to chose between BATMAN_IV and BATMAN_V when BATMAN_V is released. This option is only useful when a new batman-adv device is created and not when only a device is added to an already existing batman-adv device.
Signed-off-by: Sven Eckelmann sven@open-mesh.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
3dafbb14e5306abf23e791c750f273b05749600f batman-adv-devel/files/etc/config/batman-adv | 1 + batman-adv-devel/files/lib/netifd/proto/batadv.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/batman-adv-devel/files/etc/config/batman-adv b/batman-adv-devel/files/etc/config/batman-adv index f38855e..be97065 100644 --- a/batman-adv-devel/files/etc/config/batman-adv +++ b/batman-adv-devel/files/etc/config/batman-adv @@ -16,6 +16,7 @@ config 'mesh' 'bat0' option 'network_coding' option 'hop_penalty' option 'isolation_mark' + option 'routing_algo'
# yet another batX instance # config 'mesh' 'bat5' diff --git a/batman-adv-devel/files/lib/netifd/proto/batadv.sh b/batman-adv-devel/files/lib/netifd/proto/batadv.sh index 632a209..cbdb019 100644 --- a/batman-adv-devel/files/lib/netifd/proto/batadv.sh +++ b/batman-adv-devel/files/lib/netifd/proto/batadv.sh @@ -6,15 +6,20 @@ init_proto "$@"
proto_batadv_init_config() { proto_config_add_string "mesh" + proto_config_add_string "routing_algo" }
proto_batadv_setup() { local config="$1" local iface="$2"
- local mesh - json_get_vars mesh + local mesh routing_algo + json_get_vars mesh routing_algo
+ [ -n "$routing_algo" ] || routing_algo="BATMAN_IV" + echo "$routing_algo" > "/sys/module/batman_adv/parameters/routing_algo" + + uci get batman_adv.$mesh.routing_algo echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface" proto_init_update "$iface" 1 proto_send_update "$config"