batman-adv: use batctl for configuration of hop_penalty 451/head
authorSven Eckelmann <sven@narfation.org>
Fri, 22 Feb 2019 20:47:40 +0000 (21:47 +0100)
committerSven Eckelmann <sven@narfation.org>
Fri, 22 Feb 2019 21:49:56 +0000 (22:49 +0100)
hop_penalty is the last remaining setting which is directly writing to
sysfs instead of using a implementation (sysfs vs. netlink) abstraction
layer. batctl now provides a wrapper function that allows the script to
directly use it to take care of communicating with the driver.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv/Makefile
batman-adv/files/lib/batman-adv/config.sh

index b47e3b6609f42f5095d5b693d4d84c673d40b28f..82af6c7dcff95790f196efb4ab5b06c3661f2cfd 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=batman-adv
 
 PKG_VERSION:=2019.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_HASH:=3e97d8a771cdbd7b2df42c52b88e071eaa58b5d28eb4e17a4b13b6698debbdc0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
index a74c9d8f3ad4fed33579cc16adf7f2104af98f1e..952f93ea514dbcb56e7de104522f9c8956f2173c 100644 (file)
@@ -60,8 +60,7 @@ bat_config()
                ;;
        esac
 
-       [ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty
-
+       [ -n "$hop_penalty" ] && batctl -m "$mesh" hop_penalty "$hop_penalty"
        [ -n "$isolation_mark" ] && batctl -m "$mesh" isolation_mark "$isolation_mark"
        [ -n "$multicast_mode" ] && batctl -m "$mesh" multicast_mode "$multicast_mode" 2>&-
        [ -n "$network_coding" ] && batctl -m "$mesh" network_coding "$network_coding" 2>&-