summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_fib.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2019-06-21 17:45:26 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-24 10:18:49 -0700
commitbf9a8a061ddcd6a58b312466ea5da44ab54ce8cb (patch)
treeb7b2fc3085074fd764f28b34a729b09dc594f2be /net/ipv6/ip6_fib.c
parent3401bfb1638efdd0b721d03c51c48171a0cde8c6 (diff)
downloadlinux-bf9a8a061ddcd6a58b312466ea5da44ab54ce8cb.tar.bz2
ipv6/route: Change return code of rt6_dump_route() for partial node dumps
In the next patch, we are going to add optional dump of exceptions to rt6_dump_route(). Change the return code of rt6_dump_route() to accomodate partial node dumps: we might dump multiple routes per node, and might be able to dump only a given number of them, so fib6_dump_node() will need to know how many routes have been dumped on partial dump, to restart the dump from the point where it was interrupted. Note that fib6_dump_node() is the only caller and already handles all non-negative return codes as success: those become -1 to signal that we're done with the node. If we fail, return 0, as we were unable to dump the single route in the node, but we're not done with it. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r--net/ipv6/ip6_fib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 8a7506b3451b..3e9ce86a819c 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -465,7 +465,7 @@ static int fib6_dump_node(struct fib6_walker *w)
for_each_fib6_walker_rt(w) {
res = rt6_dump_route(rt, w->args);
- if (res < 0) {
+ if (res >= 0) {
/* Frame is full, suspend walking */
w->leaf = rt;
return 1;