This patch fixes a bug in the 'ip' command to display 
IPv6 cloned routes.
  ip -6 route ls cache
returns empty even when there are cloned routes because of
of a missing else in print_route() routine.

Thanks
Sridhar

Signed-off-by: Sridhar Samudrala <[EMAIL PROTECTED]>    

diff --git a/ip/iproute.c b/ip/iproute.c
index 6fe4a70..08feceb 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -176,18 +176,19 @@ int print_route(const struct sockaddr_nl *who, struct 
nlmsghdr *n, void *arg)
                if (filter.cloned) {
                        if (!(r->rtm_flags&RTM_F_CLONED))
                                return 0;
-               }
-               if (filter.tb) {
-                       if (r->rtm_flags&RTM_F_CLONED)
-                               return 0;
-                       if (filter.tb == RT_TABLE_LOCAL) {
-                               if (r->rtm_type != RTN_LOCAL)
+               } else {
+                       if (filter.tb) {
+                               if (r->rtm_flags&RTM_F_CLONED)
                                        return 0;
-                       } else if (filter.tb == RT_TABLE_MAIN) {
-                               if (r->rtm_type == RTN_LOCAL)
+                               if (filter.tb == RT_TABLE_LOCAL) {
+                                       if (r->rtm_type != RTN_LOCAL)
+                                               return 0;
+                               } else if (filter.tb == RT_TABLE_MAIN) {
+                                       if (r->rtm_type == RTN_LOCAL)
+                                               return 0;
+                               } else {
                                        return 0;
-                       } else {
-                               return 0;
+                               }
                        }
                }
        } else {


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to