Repository : ssh://git@diktynna/batctl
On branch : master
commit df8bf5164b6904f61ae0b0db090fb5bb41b4f06d Author: Leonardo Mörlein me@irrelefant.net Date: Wed Apr 8 23:49:03 2020 +0200
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 me@irrelefant.net [sven@narfation.org: adjusted commit message] Signed-off-by: Sven Eckelmann sven@narfation.org
df8bf5164b6904f61ae0b0db090fb5bb41b4f06d throughputmeter.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/throughputmeter.c b/throughputmeter.c index 27f1346..0ec5c31 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");