diff mbox series

[net,v5,2/6] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

Message ID 4c351295757f82ddc83f6e433150fedda5517fe1.1560827176.git.sbrivio@redhat.com
State Changes Requested
Delegated to: David Miller
Headers show
Series Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions | expand

Commit Message

Stefano Brivio June 18, 2019, 1:20 p.m. UTC
This functionally reverts the check introduced by commit
e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking")
as modified by commit e4e92fb160d7 ("net/ipv4: Bail early if user only
wants prefix entries").

As we are preparing to fix listing of IPv4 cached routes, we need to
give userspace a way to request them.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
v5: No changes

v4: New patch

 net/ipv4/fib_frontend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Ahern June 18, 2019, 2:49 p.m. UTC | #1
On 6/18/19 7:20 AM, Stefano Brivio wrote:
> This functionally reverts the check introduced by commit
> e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking")
> as modified by commit e4e92fb160d7 ("net/ipv4: Bail early if user only
> wants prefix entries").
> 
> As we are preparing to fix listing of IPv4 cached routes, we need to
> give userspace a way to request them.
> 
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---

Reviewed-by: David Ahern <dsahern@gmail.com>
diff mbox series

Patch

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index c28d60d6c9d0..fced49e473c7 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -956,8 +956,8 @@  static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
 		filter.flags = rtm->rtm_flags & (RTM_F_PREFIX | RTM_F_CLONED);
 	}
 
-	/* fib entries are never clones and ipv4 does not use prefix flag */
-	if (filter.flags & (RTM_F_PREFIX | RTM_F_CLONED))
+	/* ipv4 does not use prefix flag */
+	if (filter.flags & RTM_F_PREFIX)
 		return skb->len;
 
 	if (filter.table_id) {