]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[zebra] linux policy routing support with ipv6
authorMathieu Goessens <gebura@poolp.org>
Tue, 23 Jun 2009 14:59:45 +0000 (15:59 +0100)
committerPaul Jakma <paul@quagga.net>
Tue, 23 Jun 2009 14:59:45 +0000 (15:59 +0100)
Quagga support linux policy routing (ip route ... table $X) with zebra.conf
table $X option.  It works fine on ipv4.  On ipv6 the parameter is ignored
(table 0 is used).

* zebra/...: Pass appropriate table arg to rib_{add,delete}_ipv6

zebra/connected.c
zebra/rt_netlink.c
zebra/zserv.c

index c776408ad3af6e8407590c2a9989255d7427c2f0..95399fa16ebf8968136c9622464be6536a051221 100644 (file)
@@ -342,7 +342,7 @@ connected_up_ipv6 (struct interface *ifp, struct connected *ifc)
     return;
 #endif
 
-  rib_add_ipv6 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0,
+  rib_add_ipv6 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, RT_TABLE_MAIN,
                 ifp->metric, 0);
 
   rib_update ();
index 03df28c1a4d90f7615b956def0e11829815b6002..7652f80a99f65cecbc15b91aabdbbddd55058e97 100644 (file)
@@ -889,9 +889,9 @@ netlink_route_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
         }
 
       if (h->nlmsg_type == RTM_NEWROUTE)
-        rib_add_ipv6 (ZEBRA_ROUTE_KERNEL, 0, &p, gate, index, 0, 0, 0);
+        rib_add_ipv6 (ZEBRA_ROUTE_KERNEL, 0, &p, gate, index, table, 0, 0);
       else
-        rib_delete_ipv6 (ZEBRA_ROUTE_KERNEL, 0, &p, gate, index, 0);
+        rib_delete_ipv6 (ZEBRA_ROUTE_KERNEL, 0, &p, gate, index, table);
     }
 #endif /* HAVE_IPV6 */
 
index 05380d6244571db9221a4aef3e773329e848795e..a566e6d42106a58922abacf314df24c666c03b36 100644 (file)
@@ -964,10 +964,10 @@ zread_ipv6_add (struct zserv *client, u_short length)
     api.metric = 0;
     
   if (IN6_IS_ADDR_UNSPECIFIED (&nexthop))
-    rib_add_ipv6 (api.type, api.flags, &p, NULL, ifindex, 0, api.metric,
+    rib_add_ipv6 (api.type, api.flags, &p, NULL, ifindex, zebrad.rtm_table_default, api.metric,
                  api.distance);
   else
-    rib_add_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, 0, api.metric,
+    rib_add_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, zebrad.rtm_table_default, api.metric,
                  api.distance);
   return 0;
 }
@@ -1030,9 +1030,9 @@ zread_ipv6_delete (struct zserv *client, u_short length)
     api.metric = 0;
     
   if (IN6_IS_ADDR_UNSPECIFIED (&nexthop))
-    rib_delete_ipv6 (api.type, api.flags, &p, NULL, ifindex, 0);
+    rib_delete_ipv6 (api.type, api.flags, &p, NULL, ifindex, client->rtm_table);
   else
-    rib_delete_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, 0);
+    rib_delete_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, client->rtm_table);
   return 0;
 }