Skip to content

Commit

Permalink
net/ipv6: Bail early if user only wants cloned entries
Browse files Browse the repository at this point in the history
Similar to IPv4, IPv6 fib no longer contains cloned routes. If a user
requests a route dump for only cloned entries, no sense walking the FIB
and returning everything.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Ahern authored and David S. Miller committed Oct 16, 2018
1 parent 196cfeb commit 08e814c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,13 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
} else if (nlmsg_len(nlh) >= sizeof(struct rtmsg)) {
struct rtmsg *rtm = nlmsg_data(nlh);

if (rtm->rtm_flags & RTM_F_PREFIX)
arg.filter.flags = RTM_F_PREFIX;
arg.filter.flags = rtm->rtm_flags & (RTM_F_PREFIX|RTM_F_CLONED);
}

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

w = (void *)cb->args[2];
if (!w) {
/* New dump:
Expand Down

0 comments on commit 08e814c

Please sign in to comment.