Skip to content

Commit 08e814c

Browse files
dsaherndavem330
authored andcommitted
net/ipv6: Bail early if user only wants cloned entries
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 196cfeb commit 08e814c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/ipv6/ip6_fib.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,13 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
586586
} else if (nlmsg_len(nlh) >= sizeof(struct rtmsg)) {
587587
struct rtmsg *rtm = nlmsg_data(nlh);
588588

589-
if (rtm->rtm_flags & RTM_F_PREFIX)
590-
arg.filter.flags = RTM_F_PREFIX;
589+
arg.filter.flags = rtm->rtm_flags & (RTM_F_PREFIX|RTM_F_CLONED);
591590
}
592591

592+
/* fib entries are never clones */
593+
if (arg.filter.flags & RTM_F_CLONED)
594+
return skb->len;
595+
593596
w = (void *)cb->args[2];
594597
if (!w) {
595598
/* New dump:

0 commit comments

Comments
 (0)