batman-adv: Detect missing primaryif during tp_send as error
authorSven Eckelmann <sven@narfation.org>
Sat, 29 Oct 2016 07:18:43 +0000 (09:18 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Fri, 4 Nov 2016 11:27:39 +0000 (12:27 +0100)
The throughput meter detects different situations as problems for the
current test. It stops the test after these and reports it to userspace.
This also has to be done when the primary interface disappeared during the
test.

Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/tp_meter.c

index 2333777f919d8ef3e28055733e0d55b64d3ecff3..8af1611b8ab2c21e53b9c46bf74a9fa677d805a4 100644 (file)
@@ -837,6 +837,7 @@ static int batadv_tp_send(void *arg)
        primary_if = batadv_primary_if_get_selected(bat_priv);
        if (unlikely(!primary_if)) {
                err = BATADV_TP_REASON_DST_UNREACHABLE;
+               tp_vars->reason = err;
                goto out;
        }