From 674adedb8fc88e3a6d890b821d20d0077af51c07 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Sep 2016 19:42:20 +0200 Subject: [PATCH] alfred: upgrade package to latest release 2016.3 Signed-off-by: Sven Eckelmann --- alfred/Makefile | 11 ++-- ...ed-vis-Fix-netlink-function-fallback.patch | 40 +++++++++++++++ ...irect-neighbors-detection-with-origi.patch | 50 +++++++++++++++++++ 3 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 alfred/patches/0001-alfred-vis-Fix-netlink-function-fallback.patch create mode 100644 alfred/patches/0002-alfred-vis-Fix-direct-neighbors-detection-with-origi.patch diff --git a/alfred/Makefile b/alfred/Makefile index 8d651a5..319795a 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 https://git.open-mesh.org/alfred.git # PKG_NAME:=alfred -PKG_VERSION:=2016.2 +PKG_VERSION:=2016.3 PKG_RELEASE:=0 -PKG_MD5SUM:=cc7d5b352942477033a4cafbed84152d +PKG_MD5SUM:=8a33199b8926a960889d1cf08535ef63 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) @@ -28,7 +28,7 @@ define Package/alfred SECTION:=net CATEGORY:=Network TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon - DEPENDS:= +libc @IPV6 +librt \ + DEPENDS:= +libc @IPV6 +libnl-tiny +librt \ +ALFRED_NEEDS_lua:lua \ +ALFRED_NEEDS_libgps:libgps endef @@ -60,10 +60,13 @@ endef MAKE_ALFRED_FLAGS=\ CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ - CONFIG_ALFRED_CAPABILITIES=n + CONFIG_ALFRED_CAPABILITIES=n \ + LIBNL_NAME="libnl-tiny" \ + LIBNL_GENL_NAME="libnl-tiny" TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin +TARGET_CPPFLAGS += -D_GNU_SOURCE define Build/Compile CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ diff --git a/alfred/patches/0001-alfred-vis-Fix-netlink-function-fallback.patch b/alfred/patches/0001-alfred-vis-Fix-netlink-function-fallback.patch new file mode 100644 index 0000000..7115273 --- /dev/null +++ b/alfred/patches/0001-alfred-vis-Fix-netlink-function-fallback.patch @@ -0,0 +1,40 @@ +From 9729239306edd6c0d122b0222626988f44d9b1cf Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Thu, 22 Sep 2016 23:41:20 +0200 +Subject: [PATCH] alfred: vis: Fix netlink function fallback + +The netlink functions return -EOPNOTSUPP when the kernel doesn't support +the netlink command. The caller can then fall back to debugfs. So check for +-EOPNOTSUPP and not EOPNOTSUPP. + +Fixes: bca55a86fecd ("alfred: vis: Add support for netlink") +Signed-off-by: Sven Eckelmann +--- + vis/vis.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/vis/vis.c b/vis/vis.c +index b865508..677f8aa 100644 +--- a/vis/vis.c ++++ b/vis/vis.c +@@ -361,7 +361,7 @@ static int parse_transtable_local(struct globals *globals) + int ret; + + ret = parse_transtable_local_netlink(globals); +- if (ret != EOPNOTSUPP) ++ if (ret != -EOPNOTSUPP) + return ret; + + return parse_transtable_local_debugfs(globals); +@@ -602,7 +602,7 @@ static int parse_orig_list(struct globals *globals) + int ret; + + ret = parse_orig_list_netlink(globals); +- if (ret != EOPNOTSUPP) ++ if (ret != -EOPNOTSUPP) + return ret; + + return parse_orig_list_debugfs(globals); +-- +2.9.3 + diff --git a/alfred/patches/0002-alfred-vis-Fix-direct-neighbors-detection-with-origi.patch b/alfred/patches/0002-alfred-vis-Fix-direct-neighbors-detection-with-origi.patch new file mode 100644 index 0000000..01a8510 --- /dev/null +++ b/alfred/patches/0002-alfred-vis-Fix-direct-neighbors-detection-with-origi.patch @@ -0,0 +1,50 @@ +From: Sven Eckelmann +Date: Fri, 23 Sep 2016 15:45:12 +0200 +Subject: [PATCH] alfred: vis: Fix direct neighbors detection with originator netlink query + +Only entries in the originator table with the destination address equal to +the originator address should be handled by alfred as actual neighbors. + +Fixes: bca55a86fecd ("alfred: vis: Add support for netlink") +Signed-off-by: Sven Eckelmann +--- + vis/vis.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/vis/vis.c b/vis/vis.c +index 94e583e..f4d13c7 100644 +--- a/vis/vis.c ++++ b/vis/vis.c +@@ -453,6 +453,7 @@ err: + + static const int parse_orig_list_mandatory[] = { + BATADV_ATTR_ORIG_ADDRESS, ++ BATADV_ATTR_NEIGH_ADDRESS, + BATADV_ATTR_TQ, + BATADV_ATTR_HARD_IFINDEX, + }; +@@ -466,6 +467,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) + struct genlmsghdr *ghdr; + struct vis_list_entry *v_entry; + uint8_t *orig; ++ uint8_t *neigh; + uint8_t tq; + uint32_t hardif; + +@@ -493,12 +495,16 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg) + return NL_OK; + + orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); ++ neigh = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]); + tq = nla_get_u8(attrs[BATADV_ATTR_TQ]); + hardif = nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]); + + if (tq < 1) + return NL_OK; + ++ if (memcmp(orig, neigh, ETH_ALEN) != 0) ++ return NL_OK; ++ + v_entry = malloc(sizeof(*v_entry)); + if (!v_entry) + return NL_OK; -- 2.30.2