]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.1/ipmr_base-do-not-reset-index-in-mr_table_dump.patch
569af64444de1d4049bfdc3f8e5058533d4c5fb4
[thirdparty/kernel/stable-queue.git] / queue-5.1 / ipmr_base-do-not-reset-index-in-mr_table_dump.patch
1 From foo@baz Sun 09 Jun 2019 09:24:16 AM CEST
2 From: David Ahern <dsahern@gmail.com>
3 Date: Thu, 2 May 2019 15:14:15 -0700
4 Subject: ipmr_base: Do not reset index in mr_table_dump
5
6 From: David Ahern <dsahern@gmail.com>
7
8 [ Upstream commit 7fcd1e033dacedd520abebc943c960dcf5add3ae ]
9
10 e is the counter used to save the location of a dump when an
11 skb is filled. Once the walk of the table is complete, mr_table_dump
12 needs to return without resetting that index to 0. Dump of a specific
13 table is looping because of the reset because there is no way to
14 indicate the walk of the table is done.
15
16 Move the reset to the caller so the dump of each table starts at 0,
17 but the loop counter is maintained if a dump fills an skb.
18
19 Fixes: e1cedae1ba6b0 ("ipmr: Refactor mr_rtm_dumproute")
20 Signed-off-by: David Ahern <dsahern@gmail.com>
21 Signed-off-by: David S. Miller <davem@davemloft.net>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 ---
24 net/ipv4/ipmr_base.c | 3 +--
25 1 file changed, 1 insertion(+), 2 deletions(-)
26
27 --- a/net/ipv4/ipmr_base.c
28 +++ b/net/ipv4/ipmr_base.c
29 @@ -335,8 +335,6 @@ next_entry2:
30 }
31 spin_unlock_bh(lock);
32 err = 0;
33 - e = 0;
34 -
35 out:
36 cb->args[1] = e;
37 return err;
38 @@ -374,6 +372,7 @@ int mr_rtm_dumproute(struct sk_buff *skb
39 err = mr_table_dump(mrt, skb, cb, fill, lock, filter);
40 if (err < 0)
41 break;
42 + cb->args[1] = 0;
43 next_table:
44 t++;
45 }