Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
commit 435dfff3d96f1d6918afced7a5933bdc515dd392 Author: Filippo Sallemi tonyputi@gmail.com Date: Sun Feb 12 14:09:38 2012 +0000
batman-adv-devel: hotplug script fixes & updates
* call bat_config() instead of config_bat() (which does not exist) * support ap isolation config option * remove /etc/rc.common from script since it is not an init script anymore
Signed-off-by: Filippo Sallemi tonyputi@gmail.com
* bridge loop avoidance uci support added * batman-adv/batctl updated to latest master
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
435dfff3d96f1d6918afced7a5933bdc515dd392 batman-adv-devel/Makefile | 4 ++-- batman-adv-devel/files/etc/config/batman-adv | 1 + batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv | 2 +- batman-adv-devel/files/lib/batman-adv/config.sh | 4 ++++ batman-adv-devel/files/usr/sbin/batman-adv | 15 ++++++++++++++- 5 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index 718c9c4..ffb9958 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -10,8 +10,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv-devel
-PKG_BATMAN_REV:=052332fb1a2d694fdc10bb0ebef495bbcb6fb06d -PKG_BATCTL_REV:=7dd21c88f6c1484ce0cbf52dca7b9fc86c2c9bb0 +PKG_BATMAN_REV:=f86649b10214e8e98bdec161cefa13dcc8cb1e41 +PKG_BATCTL_REV:=1cce9654449331d13b5576e845453ff2613dbe43
PKG_BATMAN_BRANCH:=$(subst ",,$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BRANCH_NAME)) PKG_BATMAN_SHORTREV:=$(shell echo $(PKG_BATMAN_REV) | cut -c1-7) diff --git a/batman-adv-devel/files/etc/config/batman-adv b/batman-adv-devel/files/etc/config/batman-adv index 5197820..fb7b384 100644 --- a/batman-adv-devel/files/etc/config/batman-adv +++ b/batman-adv-devel/files/etc/config/batman-adv @@ -11,6 +11,7 @@ config 'mesh' 'bat0' option 'log_level' option 'orig_interval' option 'vis_mode' + option 'bridge_loop_avoidance'
# yet another batX instance # config 'mesh' 'bat5' diff --git a/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv b/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv index 2ad83cf..fe19e64 100644 --- a/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv +++ b/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv @@ -6,7 +6,7 @@ config_load batman-adv
case "$ACTION" in add) - [ -d /sys/class/net/$INTERFACE/mesh/ ] && config_bat "$INTERFACE" + [ -d /sys/class/net/$INTERFACE/mesh/ ] && bat_config "$INTERFACE" [ -d /sys/class/net/$INTERFACE/batman_adv/ ] && config_foreach bat_add_interface mesh "$INTERFACE" ;; remove) diff --git a/batman-adv-devel/files/lib/batman-adv/config.sh b/batman-adv-devel/files/lib/batman-adv/config.sh index d0569bc..dfd9580 100644 --- a/batman-adv-devel/files/lib/batman-adv/config.sh +++ b/batman-adv-devel/files/lib/batman-adv/config.sh @@ -14,6 +14,8 @@ bat_config(){ config_get orig_interval "$mesh" orig_interval config_get hop_penalty "$mesh" hop_penalty config_get vis_mode "$mesh" vis_mode + config_get ap_isolation "$mesh" ap_isolation + config_get bridge_loop_avoidance "$mesh" bridge_loop_avoidance
[ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval [ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty @@ -25,6 +27,8 @@ bat_config(){ [ -n "$gw_mode" ] && echo $gw_mode > /sys/class/net/$mesh/mesh/gw_mode [ -n "$gw_sel_class" ] && echo $gw_sel_class > /sys/class/net/$mesh/mesh/gw_sel_class [ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode + [ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation + [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance }
bat_add_interface(){ diff --git a/batman-adv-devel/files/usr/sbin/batman-adv b/batman-adv-devel/files/usr/sbin/batman-adv index 4f17991..6580756 100644 --- a/batman-adv-devel/files/usr/sbin/batman-adv +++ b/batman-adv-devel/files/usr/sbin/batman-adv @@ -1,6 +1,7 @@ -#!/bin/sh /etc/rc.common +#!/bin/sh # Copyright (C) 2011 OpenWrt.org
+. /etc/functions.sh . /lib/batman-adv/config.sh
start_mesh() { @@ -44,3 +45,15 @@ stop () { config_foreach stop_mesh mesh fi } + +restart() { + stop $1 + start $1 +} + +case "$1" in + start) start $2 ;; + stop) stop $2 ;; + restart) restart $2 ;; + *) echo "Usage: batman-adv <start|stop|restart> [mesh instance]" +esac