From: Sven Eckelmann Date: Sat, 29 Oct 2016 07:18:43 +0000 (+0200) Subject: batman-adv: Detect missing primaryif during tp_send as error X-Git-Tag: v4.8.13~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e77deda20081cdd9b5217dc41b6d00356bf15f;p=thirdparty%2Fkernel%2Fstable.git batman-adv: Detect missing primaryif during tp_send as error commit e13258f38e927b61cdb5f4ad25309450d3b127d1 upstream. 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 Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 2333777f919d8..8af1611b8ab2c 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -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; }