batman-adv: Refresh patches
[feed/routing.git] / batman-adv / patches / 0027-batman-adv-Ignore-invalid-batadv_v_gw-during-netlink.patch
1 From: Sven Eckelmann <sven.eckelmann@openmesh.com>
2 Date: Mon, 19 Feb 2018 14:08:53 +0100
3 Subject: batman-adv: Ignore invalid batadv_v_gw during netlink send
4
5 The function batadv_v_gw_dump stops the processing loop when
6 batadv_v_gw_dump_entry returns a non-0 return code. This should only
7 happen when the buffer is full. Otherwise, an empty message may be
8 returned by batadv_gw_dump. This empty message will then stop the netlink
9 dumping of gateway entries. At worst, not a single entry is returned to
10 userspace even when plenty of possible gateways exist.
11
12 Fixes: 15315a94ad98 ("batman-adv: add B.A.T.M.A.N. V bat_gw_dump implementations")
13 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
14 Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
15
16 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/12f1d3a6bf4d157928fec509aab981e5243ee438
17
18 diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
19 index 2f77e112d4cb4db7b1086715a597ef995054fdc1..0488063ff6ac5985e27c3a0df41ab3566b48abb8 100644
20 --- a/net/batman-adv/bat_v.c
21 +++ b/net/batman-adv/bat_v.c
22 @@ -930,7 +930,7 @@ static int batadv_v_gw_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
23 struct batadv_neigh_ifinfo *router_ifinfo = NULL;
24 struct batadv_neigh_node *router;
25 struct batadv_gw_node *curr_gw;
26 - int ret = -EINVAL;
27 + int ret = 0;
28 void *hdr;
29
30 router = batadv_orig_router_get(gw_node->orig_node, BATADV_IF_DEFAULT);