net: Don't return invalid table id error when dumping all families
When doing a route dump across all address families, do not error out if the table does not exist. This allows a route dump for AF_UNSPEC with a table id that may only exist for some of the families. Do return the table does not exist error if dumping routes for a specific family and the table does not exist. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
242afaa696
commit
ae677bbb44
@@ -620,6 +620,9 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
if (arg.filter.table_id) {
|
||||
tb = fib6_get_table(net, arg.filter.table_id);
|
||||
if (!tb) {
|
||||
if (arg.filter.dump_all_families)
|
||||
return skb->len;
|
||||
|
||||
NL_SET_ERR_MSG_MOD(cb->extack, "FIB table does not exist");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user