aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-10-15 18:56:42 -0700
committerDavid S. Miller <davem@davemloft.net>2018-10-16 00:13:12 -0700
commit4724676d551c0961659b1da3fb4b5928169fb184 (patch)
treeec0189bb48ecef31408ac12c3fcb5f506ffba5bf /net/ipv4/ipmr.c
parentnetlink: Add answer_flags to netlink_callback (diff)
downloadwireguard-linux-4724676d551c0961659b1da3fb4b5928169fb184.tar.xz
wireguard-linux-4724676d551c0961659b1da3fb4b5928169fb184.zip
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 <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 91b0d5671649..44d777058960 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -2527,9 +2527,13 @@ errout_free:
static int ipmr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
{
+ struct fib_dump_filter filter = {};
+
if (cb->strict_check) {
- int err = ip_valid_fib_dump_req(cb->nlh, cb->extack);
+ int err;
+ err = ip_valid_fib_dump_req(sock_net(skb->sk), cb->nlh,
+ &filter, cb->extack);
if (err < 0)
return err;
}