netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iproute2: filter routing entries based on clone flag
@ 2010-07-23 13:36 Ulrich Weber
  0 siblings, 0 replies; only message in thread
From: Ulrich Weber @ 2010-07-23 13:36 UTC (permalink / raw)
  To: shemminger; +Cc: netdev

Before IPv6 routing cache entries were always displayed
if additional tables beside MAIN and LOCAL are installed.

Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
 ip/iproute.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/ip/iproute.c b/ip/iproute.c
index 8252e18..fce7f33 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -160,14 +160,11 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 	if (r->rtm_family == AF_INET6 && table != RT_TABLE_MAIN)
 		ip6_multiple_tables = 1;
 
+	if (filter.cloned == !(r->rtm_flags&RTM_F_CLONED))
+		return 0;
+
 	if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
-		if (filter.cloned) {
-			if (!(r->rtm_flags&RTM_F_CLONED))
-				return 0;
-		}
 		if (filter.tb) {
-			if (!filter.cloned && r->rtm_flags&RTM_F_CLONED)
-				return 0;
 			if (filter.tb == RT_TABLE_LOCAL) {
 				if (r->rtm_type != RTN_LOCAL)
 					return 0;
@@ -179,10 +176,6 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			}
 		}
 	} else {
-		if (filter.cloned) {
-			if (!(r->rtm_flags&RTM_F_CLONED))
-				return 0;
-		}
 		if (filter.tb > 0 && filter.tb != table)
 			return 0;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-23 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 13:36 [PATCH] iproute2: filter routing entries based on clone flag Ulrich Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).