mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
net: Add struct for fib dump filter
Add struct fib_dump_filter for options on limiting which routes are returned in a dump request. The current list is table id, protocol, route type, rtm_flags and nexthop device index. struct net is needed to lookup the net_device from the index. Declare the filter for each route dump handler and plumb the new arguments from dump handlers to ip_valid_fib_dump_req. Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
22e6c58b8c
commit
4724676d55
7 changed files with 37 additions and 11 deletions
|
|
@ -2032,13 +2032,15 @@ nla_put_failure:
|
|||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_INET)
|
||||
static int mpls_valid_fib_dump_req(const struct nlmsghdr *nlh,
|
||||
static int mpls_valid_fib_dump_req(struct net *net, const struct nlmsghdr *nlh,
|
||||
struct fib_dump_filter *filter,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
return ip_valid_fib_dump_req(nlh, extack);
|
||||
return ip_valid_fib_dump_req(net, nlh, filter, extack);
|
||||
}
|
||||
#else
|
||||
static int mpls_valid_fib_dump_req(const struct nlmsghdr *nlh,
|
||||
static int mpls_valid_fib_dump_req(struct net *net, const struct nlmsghdr *nlh,
|
||||
struct fib_dump_filter *filter,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct rtmsg *rtm;
|
||||
|
|
@ -2070,14 +2072,16 @@ static int mpls_dump_routes(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
const struct nlmsghdr *nlh = cb->nlh;
|
||||
struct net *net = sock_net(skb->sk);
|
||||
struct mpls_route __rcu **platform_label;
|
||||
struct fib_dump_filter filter = {};
|
||||
size_t platform_labels;
|
||||
unsigned int index;
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
if (cb->strict_check) {
|
||||
int err = mpls_valid_fib_dump_req(nlh, cb->extack);
|
||||
int err;
|
||||
|
||||
err = mpls_valid_fib_dump_req(net, nlh, &filter, cb->extack);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue