From: Sven Eckelmann Date: Fri, 24 Apr 2020 18:46:29 +0000 (+0200) Subject: batctl: Merge bugfixes from 2020.1 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8b25c90ed6c1f90aa993418c1190d7d0a8507cc0;p=feed%2Frouting.git batctl: Merge bugfixes from 2020.1 * Return EXIT_FAILURE when throughputmeter failed Signed-off-by: Sven Eckelmann --- diff --git a/batctl/Makefile b/batctl/Makefile index e04eba2..47d6b78 100644 --- a/batctl/Makefile +++ b/batctl/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batctl PKG_VERSION:=2019.2 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_HASH:=fb656208ff7d4cd8b1b422f60c9e6d8747302a347cbf6c199d7afa9b80f80ea3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/batctl/patches/0006-batctl-Return-EXIT_FAILURE-when-throughputmeter-fail.patch b/batctl/patches/0006-batctl-Return-EXIT_FAILURE-when-throughputmeter-fail.patch new file mode 100644 index 0000000..fc7131d --- /dev/null +++ b/batctl/patches/0006-batctl-Return-EXIT_FAILURE-when-throughputmeter-fail.patch @@ -0,0 +1,37 @@ +From: Leonardo Mörlein +Date: Wed, 8 Apr 2020 23:49:03 +0200 +Subject: batctl: Return EXIT_FAILURE when throughputmeter failed + +The command returned a success even an error was shown during the +execution. + + $ (sudo batctl tp 77:77:77:77:77:77 && echo true) || echo false + Destination unreachable + true + +Instead it should indicate a failure when the kernel replied with a +non-success return_value: + + $ (sudo ./batctl tp 77:77:77:77:77:77 && echo true) || echo false + Destination unreachable + false + +Fixes: f109b3473f86 ("batctl: introduce throughput meter support") +Signed-off-by: Leonardo Mörlein +[sven@narfation.org: adjusted commit message] +Signed-off-by: Sven Eckelmann + +Origin: upstream, https://git.open-mesh.org/batctl.git/commit/df8bf5164b6904f61ae0b0db090fb5bb41b4f06d + +diff --git a/throughputmeter.c b/throughputmeter.c +index f9d98cfcac86d7a9398e2adddd143924b38e50b0..f19d4891981c99b7b9f3fae39c8d59f549243d0a 100644 +--- a/throughputmeter.c ++++ b/throughputmeter.c +@@ -465,6 +465,7 @@ static int throughputmeter(struct state *state, int argc, char **argv) + goto out; + } + ++ ret = EXIT_FAILURE; + switch (result.return_value) { + case BATADV_TP_REASON_DST_UNREACHABLE: + fprintf(stderr, "Destination unreachable\n");