Merge pull request #270 from ecsv/batadv-17.01
authorSimon Wunderlich <sw@simonwunderlich.de>
Fri, 3 Feb 2017 18:06:09 +0000 (19:06 +0100)
committerGitHub <noreply@github.com>
Fri, 3 Feb 2017 18:06:09 +0000 (19:06 +0100)
LEDE-17.01: batman-adv: maint patch import + settings fixes

alfred/Makefile
batctl/Makefile
batman-adv/Config.in
batman-adv/Makefile
batman-adv/files/etc/config/batman-adv
batman-adv/files/lib/batman-adv/config.sh
batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch [new file with mode: 0644]

index b5d37ceef6e291d940dfcdf17c91c52b81ccfe07..379c0fe4d84d40723037b05c81aa155d78c50b3a 100644 (file)
@@ -14,6 +14,7 @@ PKG_NAME:=alfred
 PKG_VERSION:=2016.5
 PKG_RELEASE:=0
 PKG_MD5SUM:=e03d422ed3b5a162b90e8af13389523f
+PKG_HASH:=37b3babf7f37643cf296be11fb82d5730cf441a5a56f72fba96edae9f149c9d2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
index bf305a24b522f118b3f52784dfd4fb28e38db351..60c3dd9801a557012eb2fd71fa11c77b435b138a 100644 (file)
@@ -12,6 +12,7 @@ PKG_NAME:=batctl
 PKG_VERSION:=2016.5
 PKG_RELEASE:=0
 PKG_MD5SUM:=7b33fb47c7fa5b317e9a152a286999fc
+PKG_HASH:=07edeb1d87a548285be8c499542790a158fc8d94ef7ebb295f27ebf710024ae9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
index 8c75f318e9001d7853145232060057d664931aae..1b2399fc0ba6fecb8b9dd7c1abf3a0d791ae4621 100644 (file)
@@ -32,4 +32,4 @@ config KMOD_BATMAN_ADV_NC
 config KMOD_BATMAN_ADV_BATMAN_V
        bool "enable batman v routing algorithm"
        depends on PACKAGE_kmod-batman-adv
-       default n
+       default y
index 4c8e74082475e32f36a84c4172746b23e2efad89..23dd7324a4942588a6978ccde064b60ce76a171c 100644 (file)
@@ -11,8 +11,9 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=batman-adv
 
 PKG_VERSION:=2016.5
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 PKG_MD5SUM:=6717a933a08dd2a01b00df30cb9f16a8
+PKG_HASH:=d0a0fc90c4f410b57d043215e253bb0b855efa5edbe165d87c17bfdcfafd0db7
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
index f38855ebac5873c0f1243f33e37cfc979df3da87..97be6223524e912c4d98c98debe702e56b0c500b 100644 (file)
@@ -9,7 +9,6 @@ config 'mesh' 'bat0'
        option 'gw_sel_class'
        option 'log_level'
        option 'orig_interval'
-       option 'vis_mode'
        option 'bridge_loop_avoidance'
        option 'distributed_arp_table'
        option 'multicast_mode'
index 1429a43a9053f3f6c96a5747144b1c31265b3917..3a746a3c0e280b9a01ae67ea27bde65619b77ebc 100644 (file)
@@ -13,7 +13,7 @@ bat_config()
        local mesh="$1"
        local aggregated_ogms ap_isolation bonding bridge_loop_avoidance distributed_arp_table fragmentation
        local gw_bandwidth gw_mode gw_sel_class isolation_mark hop_penalty multicast_mode network_coding log_level
-       local orig_interval vis_mode
+       local orig_interval
 
        config_get aggregated_ogms "$mesh" aggregated_ogms
        config_get ap_isolation "$mesh" ap_isolation
@@ -30,11 +30,10 @@ bat_config()
        config_get network_coding "$mesh" network_coding
        config_get log_level "$mesh" log_level
        config_get orig_interval "$mesh" orig_interval
-       config_get vis_mode "$mesh" vis_mode
 
        [ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv mesh $mesh does not exist - check your interface configuration" && return 1
 
-       [ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms
+       [ -n "$aggregated_ogms" ] && echo $aggregated_ogms > /sys/class/net/$mesh/mesh/aggregated_ogms
        [ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation
        [ -n "$bonding" ] && echo $bonding > /sys/class/net/$mesh/mesh/bonding
        [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance 2>&-
@@ -49,5 +48,4 @@ bat_config()
        [ -n "$network_coding" ] && echo $network_coding > /sys/class/net/$mesh/mesh/network_coding 2>&-
        [ -n "$log_level" ] && echo $log_level > /sys/class/net/$mesh/mesh/log_level 2>&-
        [ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval
-       [ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode
 }
diff --git a/batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch b/batman-adv/patches/0002-batman-adv-Decrease-hardif-refcnt-on-fragmentation-s.patch
new file mode 100644 (file)
index 0000000..92da394
--- /dev/null
@@ -0,0 +1,63 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Tue, 27 Dec 2016 08:51:17 +0100
+Subject: [PATCH] batman-adv: Decrease hardif refcnt on fragmentation send error
+
+An error before the hardif is found has to free the skb. But every error
+after that has to free the skb + put the hard interface.
+
+Fixes: 8b4132b1447a ("batman-adv: Consume skb in batadv_frag_send_packet")
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
+---
+ net/batman-adv/fragmentation.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
+index 9c561e6..0854ebd 100644
+--- a/net/batman-adv/fragmentation.c
++++ b/net/batman-adv/fragmentation.c
+@@ -474,7 +474,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+       primary_if = batadv_primary_if_get_selected(bat_priv);
+       if (!primary_if) {
+               ret = -EINVAL;
+-              goto put_primary_if;
++              goto free_skb;
+       }
+       /* Create one header to be copied to all fragments */
+@@ -502,7 +502,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               skb_fragment = batadv_frag_create(skb, &frag_header, mtu);
+               if (!skb_fragment) {
+                       ret = -ENOMEM;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+               batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_TX);
+@@ -511,7 +511,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               ret = batadv_send_unicast_skb(skb_fragment, neigh_node);
+               if (ret != NET_XMIT_SUCCESS) {
+                       ret = NET_XMIT_DROP;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+               frag_header.no++;
+@@ -519,7 +519,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+               /* The initial check in this function should cover this case */
+               if (frag_header.no == BATADV_FRAG_MAX_FRAGMENTS - 1) {
+                       ret = -EINVAL;
+-                      goto free_skb;
++                      goto put_primary_if;
+               }
+       }
+@@ -527,7 +527,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
+       if (batadv_skb_head_push(skb, header_size) < 0 ||
+           pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) {
+               ret = -ENOMEM;
+-              goto free_skb;
++              goto put_primary_if;
+       }
+       memcpy(skb->data, &frag_header, header_size);