Update batman-adv and alfred to v2015.0 + patches from the Gluon master

remotes/1699402720531464663/tmp_refs/heads/stable
Matthias Schiffer 2015-08-06 21:51:00 +02:00
parent 753d51b6b7
commit 8bd20540a8
4 changed files with 1677 additions and 298 deletions

View File

@ -1,52 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 7 Jan 2015 16:40:43 +0100
Subject: Update batman-adv and alfred to v2014.4
diff --git a/alfred/Makefile b/alfred/Makefile
index 648a5ef..0a5fcac 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -11,9 +11,9 @@ include $(TOPDIR)/rules.mk
# The latest alfred git hash in PKG_REV can be obtained from http://git.open-mesh.org/alfred.git
#
PKG_NAME:=alfred
-PKG_VERSION:=2014.3.0
+PKG_VERSION:=2014.4.0
PKG_RELEASE:=0
-PKG_MD5SUM:=b8ab5677ed73d817b02b0e4fae10357a
+PKG_MD5SUM:=053cb5d9e7ca9384598e82944343dea2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
diff --git a/batctl/Makefile b/batctl/Makefile
index ae22286..1009b03 100644
--- a/batctl/Makefile
+++ b/batctl/Makefile
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batctl
-PKG_VERSION:=2014.2.0
+PKG_VERSION:=2014.4.0
PKG_RELEASE:=1
-PKG_MD5SUM:=c196cf95b7324d9123b701a56b06b31d
+PKG_MD5SUM:=f3a14565699313258ee6ba3de783eb0a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
diff --git a/batman-adv/Makefile b/batman-adv/Makefile
index 889dea7..0d5ed33 100644
--- a/batman-adv/Makefile
+++ b/batman-adv/Makefile
@@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv
-PKG_VERSION:=2014.2.0
+PKG_VERSION:=2014.4.0
PKG_RELEASE:=1
-PKG_MD5SUM:=1243029b3a3e2f4fa721d1a59c2faaf5
+PKG_MD5SUM:=b1518e84ce530883d224c6ca4c673ce8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)

View File

@ -1,25 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 7 Jan 2015 16:45:09 +0100
Subject: alfred: adjust intervals
diff --git a/alfred/patches/0001-alfred-adjust-intervals.patch b/alfred/patches/0001-alfred-adjust-intervals.patch
new file mode 100644
index 0000000..a8e0b4d
--- /dev/null
+++ b/alfred/patches/0001-alfred-adjust-intervals.patch
@@ -0,0 +1,15 @@
+--- a/alfred.h
++++ b/alfred.h
+@@ -32,10 +32,10 @@
+ #include "list.h"
+ #include "packet.h"
+
+-#define ALFRED_INTERVAL 10
++#define ALFRED_INTERVAL 60
+ #define ALFRED_IF_CHECK_INTERVAL 60
+ #define ALFRED_REQUEST_TIMEOUT 10
+-#define ALFRED_SERVER_TIMEOUT 60
++#define ALFRED_SERVER_TIMEOUT 180
+ #define ALFRED_DATA_TIMEOUT 600
+ #define ALFRED_SOCK_PATH_DEFAULT "/var/run/alfred.sock"
+ #define NO_FILTER -1

View File

@ -1,221 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 2 Apr 2015 20:24:14 +0200
Subject: batman-adv: introduce 'no_rebroadcast' option
diff --git a/batman-adv/files/lib/netifd/proto/batadv.sh b/batman-adv/files/lib/netifd/proto/batadv.sh
index 632a209..01f567f 100644
--- a/batman-adv/files/lib/netifd/proto/batadv.sh
+++ b/batman-adv/files/lib/netifd/proto/batadv.sh
@@ -6,16 +6,19 @@ init_proto "$@"
proto_batadv_init_config() {
proto_config_add_string "mesh"
+ proto_config_add_string "mesh_no_rebroadcast"
}
proto_batadv_setup() {
local config="$1"
local iface="$2"
- local mesh
- json_get_vars mesh
+ local mesh mesh_no_rebroadcast
+ json_get_vars mesh mesh_no_rebroadcast
echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface"
+ [ -n "$mesh_no_rebroadcast" ] && echo "$mesh_no_rebroadcast" > "/sys/class/net/$iface/batman_adv/no_rebroadcast"
+
proto_init_update "$iface" 1
proto_send_update "$config"
}
diff --git a/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch
new file mode 100644
index 0000000..cd79917
--- /dev/null
+++ b/batman-adv/patches/0001-batman-adv-introduce-no_rebroadcast-option.patch
@@ -0,0 +1,185 @@
+From 5ba3f1eac041857deabe39432fdfe1a584bbdd81 Mon Sep 17 00:00:00 2001
+Message-Id: <5ba3f1eac041857deabe39432fdfe1a584bbdd81.1420645650.git.mschiffer@universe-factory.net>
+From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de>
+Date: Tue, 24 Sep 2013 04:36:27 +0200
+Subject: [PATCH] batman-adv: introduce 'no_rebroadcast' option
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch introduces a new sysfs option named "no_rebroadcast" on
+a per hard interface basis. It allows manually enabling a split-horizon
+like behaviour for the layer 2 multicast payload frames, in that
+incoming multicast payload frames on such a hard interface are only
+being rebroadcasted on all interfaces except the incoming one instead
+of being rebroadcasted on all interfaces.
+
+Such an option should only be enabled if you are certain that these
+rebroadcasts are unnecessary. This is usually the case for instance
+for point-to-point wifi longshots or wired links.
+
+This option can especially safe a significant amount of upload overhead
+if the neighbourhood on a link is rather large, for instance in some
+transitive, symmetric VPN configurations.
+
+Using this option wrongly will break your mesh network, use this option
+wisely and at your own risk!
+
+Signed-off-by: Linus Lüssing <linus.luessing@web.de>
+---
+ hard-interface.c | 2 ++
+ send.c | 4 ++++
+ sysfs-class-net-batman-adv | 10 ++++++++
+ sysfs.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++
+ types.h | 1 +
+ 5 files changed, 76 insertions(+)
+
+diff --git a/hard-interface.c b/hard-interface.c
+index fbda6b5..3997f9c 100644
+--- a/hard-interface.c
++++ b/hard-interface.c
+@@ -591,6 +591,8 @@ batadv_hardif_add_interface(struct net_device *net_dev)
+ /* extra reference for return */
+ atomic_set(&hard_iface->refcount, 2);
+
++ atomic_set(&hard_iface->no_rebroadcast, 0);
++
+ batadv_check_known_mac_addr(hard_iface->net_dev);
+ list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
+
+diff --git a/send.c b/send.c
+index d27161e..4383a66 100644
+--- a/send.c
++++ b/send.c
+@@ -513,6 +513,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work)
+ if (forw_packet->num_packets >= hard_iface->num_bcasts)
+ continue;
+
++ if (atomic_read(&hard_iface->no_rebroadcast) &&
++ forw_packet->skb->dev == hard_iface->net_dev)
++ continue;
++
+ /* send a copy of the saved skb */
+ skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
+ if (skb1)
+diff --git a/sysfs-class-net-batman-adv b/sysfs-class-net-batman-adv
+index 7f34a95..cf7fe00 100644
+--- a/sysfs-class-net-batman-adv
++++ b/sysfs-class-net-batman-adv
+@@ -13,3 +13,13 @@ Description:
+ displays the batman mesh interface this <iface>
+ currently is associated with.
+
++What: /sys/class/net/<iface>/batman-adv/no_rebroadcast
++Date: Sep 2013
++Contact: Linus Lüssing <linus.luessing@web.de>
++Description:
++ With this option set incoming multicast payload frames on
++ <iface> are not being rebroadcasted on <iface> again. This
++ option should be set on links which are known to be transitive
++ and symmetric only, for instance point-to-point wifi longshots
++ or wired links. Using this option wrongly is going to
++ break your mesh network, use at your own risk!
+diff --git a/sysfs.c b/sysfs.c
+index fc47baa..adaeca4 100644
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -110,6 +110,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \
+ .store = _store, \
+ }
+
++/* Use this, if you have customized show and store functions
++ * for hard interface attrs
++ */
++#define BATADV_ATTR_HIF(_name, _mode, _show, _store) \
++struct batadv_attribute batadv_attr_hif_##_name = { \
++ .attr = {.name = __stringify(_name), \
++ .mode = _mode }, \
++ .show = _show, \
++ .store = _store, \
++};
++
+ /* Use this, if you have customized show and store functions */
+ #define BATADV_ATTR(_name, _mode, _show, _store) \
+ struct batadv_attribute batadv_attr_##_name = { \
+@@ -221,6 +232,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \
+ static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \
+ batadv_store_vlan_##_name)
+
++#define BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
++ssize_t batadv_store_hif_##_name(struct kobject *kobj, \
++ struct attribute *attr, char *buff, \
++ size_t count) \
++{ \
++ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
++ struct batadv_hard_iface *hard_iface; \
++ size_t res; \
++ \
++ hard_iface = batadv_hardif_get_by_netdev(net_dev); \
++ if (!hard_iface) \
++ return 0; \
++ \
++ res = __batadv_store_bool_attr(buff, count, _post_func, \
++ attr, &hard_iface->_name, \
++ hard_iface->soft_iface); \
++ batadv_hardif_free_ref(hard_iface); \
++ return res; \
++}
++
++#define BATADV_ATTR_HIF_SHOW_BOOL(_name) \
++ssize_t batadv_show_hif_##_name(struct kobject *kobj, \
++ struct attribute *attr, char *buff) \
++{ \
++ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
++ struct batadv_hard_iface *hard_iface; \
++ size_t res; \
++ \
++ hard_iface = batadv_hardif_get_by_netdev(net_dev); \
++ if (!hard_iface) \
++ return 0; \
++ \
++ res = sprintf(buff, "%s\n", \
++ atomic_read(&hard_iface->_name) == 0 ? \
++ "disabled" : "enabled"); \
++ batadv_hardif_free_ref(hard_iface); \
++ return res; \
++}
++
++/* Use this, if you are going to turn a [name] in the vlan struct on or off */
++#define BATADV_ATTR_HIF_BOOL(_name, _mode, _post_func) \
++ static BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \
++ static BATADV_ATTR_HIF_SHOW_BOOL(_name) \
++ static BATADV_ATTR_HIF(_name, _mode, batadv_show_hif_##_name, \
++ batadv_store_hif_##_name)
++
+ static int batadv_store_bool_attr(char *buff, size_t count,
+ struct net_device *net_dev,
+ const char *attr_name, atomic_t *attr)
+@@ -844,10 +901,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj,
+ static BATADV_ATTR(mesh_iface, S_IRUGO | S_IWUSR, batadv_show_mesh_iface,
+ batadv_store_mesh_iface);
+ static BATADV_ATTR(iface_status, S_IRUGO, batadv_show_iface_status, NULL);
++BATADV_ATTR_HIF_BOOL(no_rebroadcast, S_IRUGO | S_IWUSR, NULL);
+
+ static struct batadv_attribute *batadv_batman_attrs[] = {
+ &batadv_attr_mesh_iface,
+ &batadv_attr_iface_status,
++ &batadv_attr_hif_no_rebroadcast,
+ NULL,
+ };
+
+diff --git a/types.h b/types.h
+index 8854c05..39619fb 100644
+--- a/types.h
++++ b/types.h
+@@ -101,6 +101,7 @@ struct batadv_hard_iface {
+ struct batadv_hard_iface_bat_iv bat_iv;
+ struct work_struct cleanup_work;
+ struct dentry *debug_dir;
++ atomic_t no_rebroadcast;
+ };
+
+ /**
+--
+2.2.1
+