diff options
| -rw-r--r-- | net/ipv6/ip6_fib.c | 2 | ||||
| -rw-r--r-- | net/ipv6/route.c | 16 |
2 files changed, 11 insertions, 7 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) | |||
| 465 | 465 | ||
| 466 | for_each_fib6_walker_rt(w) { | 466 | for_each_fib6_walker_rt(w) { |
| 467 | res = rt6_dump_route(rt, w->args); | 467 | res = rt6_dump_route(rt, w->args); |
| 468 | if (res < 0) { | 468 | if (res >= 0) { |
| 469 | /* Frame is full, suspend walking */ | 469 | /* Frame is full, suspend walking */ |
| 470 | w->leaf = rt; | 470 | w->leaf = rt; |
| 471 | return 1; | 471 | return 1; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 0a7c21ac0b95..7c86ef046ebb 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -5522,6 +5522,7 @@ static bool fib6_info_uses_dev(const struct fib6_info *f6i, | |||
| 5522 | return false; | 5522 | return false; |
| 5523 | } | 5523 | } |
| 5524 | 5524 | ||
| 5525 | /* Return -1 if done with node, number of handled routes on partial dump */ | ||
| 5525 | int rt6_dump_route(struct fib6_info *rt, void *p_arg) | 5526 | int rt6_dump_route(struct fib6_info *rt, void *p_arg) |
| 5526 | { | 5527 | { |
| 5527 | struct rt6_rtnl_dump_arg *arg = (struct rt6_rtnl_dump_arg *) p_arg; | 5528 | struct rt6_rtnl_dump_arg *arg = (struct rt6_rtnl_dump_arg *) p_arg; |
| @@ -5530,25 +5531,28 @@ int rt6_dump_route(struct fib6_info *rt, void *p_arg) | |||
| 5530 | struct net *net = arg->net; | 5531 | struct net *net = arg->net; |
| 5531 | 5532 | ||
| 5532 | if (rt == net->ipv6.fib6_null_entry) | 5533 | if (rt == net->ipv6.fib6_null_entry) |
| 5533 | return 0; | 5534 | return -1; |
| 5534 | 5535 | ||
| 5535 | if ((filter->flags & RTM_F_PREFIX) && | 5536 | if ((filter->flags & RTM_F_PREFIX) && |
| 5536 | !(rt->fib6_flags & RTF_PREFIX_RT)) { | 5537 | !(rt->fib6_flags & RTF_PREFIX_RT)) { |
| 5537 | /* success since this is not a prefix route */ | 5538 | /* success since this is not a prefix route */ |
| 5538 | return 1; | 5539 | return -1; |
| 5539 | } | 5540 | } |
| 5540 | if (filter->filter_set) { | 5541 | if (filter->filter_set) { |
| 5541 | if ((filter->rt_type && rt->fib6_type != filter->rt_type) || | 5542 | if ((filter->rt_type && rt->fib6_type != filter->rt_type) || |
| 5542 | (filter->dev && !fib6_info_uses_dev(rt, filter->dev)) || | 5543 | (filter->dev && !fib6_info_uses_dev(rt, filter->dev)) || |
| 5543 | (filter->protocol && rt->fib6_protocol != filter->protocol)) { | 5544 | (filter->protocol && rt->fib6_protocol != filter->protocol)) { |
| 5544 | return 1; | 5545 | return -1; |
| 5545 | } | 5546 | } |
| 5546 | flags |= NLM_F_DUMP_FILTERED; | 5547 | flags |= NLM_F_DUMP_FILTERED; |
| 5547 | } | 5548 | } |
| 5548 | 5549 | ||
| 5549 | return rt6_fill_node(net, arg->skb, rt, NULL, NULL, NULL, 0, | 5550 | if (rt6_fill_node(net, arg->skb, rt, NULL, NULL, NULL, 0, RTM_NEWROUTE, |
| 5550 | RTM_NEWROUTE, NETLINK_CB(arg->cb->skb).portid, | 5551 | NETLINK_CB(arg->cb->skb).portid, |
| 5551 | arg->cb->nlh->nlmsg_seq, flags); | 5552 | arg->cb->nlh->nlmsg_seq, flags)) |
| 5553 | return 0; | ||
| 5554 | |||
| 5555 | return -1; | ||
| 5552 | } | 5556 | } |
| 5553 | 5557 | ||
| 5554 | static int inet6_rtm_valid_getroute_req(struct sk_buff *skb, | 5558 | static int inet6_rtm_valid_getroute_req(struct sk_buff *skb, |
