From: Sven Eckelmann Date: Tue, 19 Jan 2016 11:40:10 +0000 (+0100) Subject: batman-adv: Allow to select routing algorithm X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=6363b1ddc5f73558ab94573b74cd4d3d600233ff;p=lede-routing%2F.git 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 --- diff --git a/batman-adv/files/lib/netifd/proto/batadv.sh b/batman-adv/files/lib/netifd/proto/batadv.sh index 632a209..1e0c9d0 100644 --- a/batman-adv/files/lib/netifd/proto/batadv.sh +++ b/batman-adv/files/lib/netifd/proto/batadv.sh @@ -6,14 +6,18 @@ 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" echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface" proto_init_update "$iface" 1