Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08e814c9 authored by David Ahern's avatar David Ahern Committed by David S. Miller
Browse files

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: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 196cfebf
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -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)) {
	} else if (nlmsg_len(nlh) >= sizeof(struct rtmsg)) {
		struct rtmsg *rtm = nlmsg_data(nlh);
		struct rtmsg *rtm = nlmsg_data(nlh);


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


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

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