Skip to content

Commit

Permalink
ipv6: properly check return value in inet6_dump_all()
Browse files Browse the repository at this point in the history
Make sure we call fib6_dump_end() if it happens that skb->len
is zero. rtnl_dump_all() can reset cb->args on the next loop
iteration there.

Fixes: 08e814c ("net/ipv6: Bail early if user only wants cloned entries")
Fixes: ae677bb ("net: Don't return invalid table id error when dumping all families")
Signed-off-by: Alexey Kodanev <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
akodanev authored and davem330 committed Nov 6, 2018
1 parent 5e1acb4 commit e22d0bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)

/* fib entries are never clones */
if (arg.filter.flags & RTM_F_CLONED)
return skb->len;
goto out;

w = (void *)cb->args[2];
if (!w) {
Expand Down Expand Up @@ -621,7 +621,7 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
tb = fib6_get_table(net, arg.filter.table_id);
if (!tb) {
if (arg.filter.dump_all_families)
return skb->len;
goto out;

NL_SET_ERR_MSG_MOD(cb->extack, "FIB table does not exist");
return -ENOENT;
Expand Down

0 comments on commit e22d0bf

Please sign in to comment.