]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Static route does not reach kernel.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Wed, 24 Jun 2009 17:15:36 +0000 (19:15 +0200)
committerPaul Jakma <paul@quagga.net>
Wed, 24 Jun 2009 21:43:58 +0000 (22:43 +0100)
A static route like below: ip route 172.16.1.0/30 192.168.101.162 11
does not move properly to a new interface when the
interface used goes down. Zebra reports that it have
moved but kernel isn't informed so the route is lost.

* zebra_rib.c: (nexthop_active_update) if ifindex has changed, then the
  route should be considered to have changed.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
zebra/zebra_rib.c

index e2108fcb199d70a6db4569f576a09721602a3c21..e11afaf1360468f8359207b172fe195d8238f8ff 100644 (file)
@@ -905,7 +905,7 @@ static int
 nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
 {
   struct nexthop *nexthop;
-  int prev_active, new_active;
+  int prev_active, prev_index, new_active;
 
   rib->nexthop_active_num = 0;
   UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
@@ -913,9 +913,11 @@ nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
   for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
   {
     prev_active = CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+    prev_index = nexthop->ifindex;
     if ((new_active = nexthop_active_check (rn, rib, nexthop, set)))
       rib->nexthop_active_num++;
-    if (prev_active != new_active)
+    if (prev_active != new_active ||
+       prev_index != nexthop->ifindex)
       SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
   }
   return rib->nexthop_active_num;