]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
The current behaviour for IPv6 routing table filters is to derive the
authorPatrick McHardy <kaber@trash.net>
Thu, 10 Aug 2006 20:42:58 +0000 (22:42 +0200)
committerStephen Hemminger <shemminger@osdl.org>
Thu, 10 Aug 2006 20:56:13 +0000 (13:56 -0700)
table from the route type. This doesn't really work anymore now that IPv6
supports multiple tables. Add detection for IPv6 multiple table support
(relying on the fact that the first routes dumped belong to the local table
and have rtm_table == RT_TABLE_LOCAL with multiple tables) and handle it
like other protocols.

Signed-off-by: Patrick McHardy <kaber@trash.net>
ip/iproute.c

index 8f4a55d5b2fe6d231b856670d86a8300b831ef94..1645f0b4ee400cce1eaaf5c7a86720f59385d021 100644 (file)
@@ -138,6 +138,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        inet_prefix prefsrc;
        inet_prefix via;
        int host_len = -1;
+       static int ip6_multiple_tables;
        SPRINT_BUF(b1);
        
 
@@ -163,7 +164,10 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        else if (r->rtm_family == AF_IPX)
                host_len = 80;
 
-       if (r->rtm_family == AF_INET6) {
+       if (r->rtm_family == AF_INET6 && r->rtm_table != RT_TABLE_MAIN)
+               ip6_multiple_tables = 1;
+
+       if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
                if (filter.tb) {
                        if (filter.tb < 0) {
                                if (!(r->rtm_flags&RTM_F_CLONED))