]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Fix bug in display of ipv6 cloned/cached routes
authorSridhar Samudrala <sri@us.ibm.com>
Wed, 22 Aug 2007 17:55:47 +0000 (10:55 -0700)
committerStephen Hemminger <shemminger@linux-foundation.org>
Wed, 22 Aug 2007 17:55:47 +0000 (10:55 -0700)
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.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
ip/iproute.c

index 6fe4a700e8089f4a1e13fb9aced0a88e94942273..9694bc7b983910f9634aac54da4b9debda9a1976 100644 (file)
@@ -178,7 +178,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                                return 0;
                }
                if (filter.tb) {
-                       if (r->rtm_flags&RTM_F_CLONED)
+                       if (!filter.cloned && r->rtm_flags&RTM_F_CLONED)
                                return 0;
                        if (filter.tb == RT_TABLE_LOCAL) {
                                if (r->rtm_type != RTN_LOCAL)
@@ -191,6 +191,10 @@ 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;
        }