* [PATCH net] ipmr_base: Do not reset index in mr_table_dump
@ 2019-05-02 22:14 David Ahern
2019-05-04 5:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2019-05-02 22:14 UTC (permalink / raw)
To: davem; +Cc: netdev, David Ahern
From: David Ahern <dsahern@gmail.com>
e is the counter used to save the location of a dump when an
skb is filled. Once the walk of the table is complete, mr_table_dump
needs to return without resetting that index to 0. Dump of a specific
table is looping because of the reset because there is no way to
indicate the walk of the table is done.
Move the reset to the caller so the dump of each table starts at 0,
but the loop counter is maintained if a dump fills an skb.
Fixes: e1cedae1ba6b0 ("ipmr: Refactor mr_rtm_dumproute")
Signed-off-by: David Ahern <dsahern@gmail.com>
---
net/ipv4/ipmr_base.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c
index 3e614cc824f7..3a1af50bd0a5 100644
--- a/net/ipv4/ipmr_base.c
+++ b/net/ipv4/ipmr_base.c
@@ -335,8 +335,6 @@ int mr_table_dump(struct mr_table *mrt, struct sk_buff *skb,
}
spin_unlock_bh(lock);
err = 0;
- e = 0;
-
out:
cb->args[1] = e;
return err;
@@ -374,6 +372,7 @@ int mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb,
err = mr_table_dump(mrt, skb, cb, fill, lock, filter);
if (err < 0)
break;
+ cb->args[1] = 0;
next_table:
t++;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] ipmr_base: Do not reset index in mr_table_dump
2019-05-02 22:14 [PATCH net] ipmr_base: Do not reset index in mr_table_dump David Ahern
@ 2019-05-04 5:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-05-04 5:39 UTC (permalink / raw)
To: dsahern; +Cc: netdev, dsahern
From: David Ahern <dsahern@kernel.org>
Date: Thu, 2 May 2019 15:14:15 -0700
> From: David Ahern <dsahern@gmail.com>
>
> e is the counter used to save the location of a dump when an
> skb is filled. Once the walk of the table is complete, mr_table_dump
> needs to return without resetting that index to 0. Dump of a specific
> table is looping because of the reset because there is no way to
> indicate the walk of the table is done.
>
> Move the reset to the caller so the dump of each table starts at 0,
> but the loop counter is maintained if a dump fills an skb.
>
> Fixes: e1cedae1ba6b0 ("ipmr: Refactor mr_rtm_dumproute")
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-04 5:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02 22:14 [PATCH net] ipmr_base: Do not reset index in mr_table_dump David Ahern
2019-05-04 5:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).