batman-adv: Ignore invalid batadv_iv_gw during netlink send
authorSven Eckelmann <sven.eckelmann@openmesh.com>
Mon, 19 Feb 2018 13:08:52 +0000 (14:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:50:31 +0000 (07:50 +0200)
commit280a7b6f18fd0fd4cee2029c50a4ddf351817334
tree08deae5d5993a28ad30c7b3fc14893c61614fe30
parentd505165f3787350b6268a9b11e7ab2298f83f2fc
batman-adv: Ignore invalid batadv_iv_gw during netlink send

[ Upstream commit 10d570284258a30dc104c50787c5289ec49f3d23 ]

The function batadv_iv_gw_dump stops the processing loop when
batadv_iv_gw_dump_entry returns a non-0 return code. This should only
happen when the buffer is full. Otherwise, an empty message may be
returned by batadv_gw_dump. This empty message will then stop the netlink
dumping of gateway entries. At worst, not a single entry is returned to
userspace even when plenty of possible gateways exist.

Fixes: efb766af06e3 ("batman-adv: add B.A.T.M.A.N. IV bat_gw_dump implementations")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/bat_iv_ogm.c