summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-04-29 16:55:30 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-04-29 16:55:30 -0700
commite87f46b4abc10fe3fc59562d6be25fb96bce1970 (patch)
tree33c354edc6b2e33568c53628f64895546c6cb685 /zebra
parent9213f3522168423cbbd74da3ed234ebd5c62f0f4 (diff)
parentd3ea74a99a3d2bcc66e45bef716ba0a66e24020e (diff)
downloadquagga-e87f46b4abc10fe3fc59562d6be25fb96bce1970.tar.bz2
quagga-e87f46b4abc10fe3fc59562d6be25fb96bce1970.tar.xz
Merge branch 'glendale' into hollister
Diffstat (limited to 'zebra')
-rw-r--r--zebra/interface.c16
-rw-r--r--zebra/zebra_rib.c47
2 files changed, 58 insertions, 5 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 7dc1b68d..cfcd5120 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -538,15 +538,25 @@ if_down (struct interface *ifp)
if (p->family == AF_INET)
connected_down_ipv4 (ifp, ifc);
+ }
+ }
+
+ /* Examine all static routes which direct to the interface. */
+ rib_update ();
+
#ifdef HAVE_IPV6
- else if (p->family == AF_INET6)
+ if (ifp->connected)
+ {
+ for (ALL_LIST_ELEMENTS (ifp->connected, node, next, ifc))
+ {
+ p = ifc->address;
+ if (p->family == AF_INET6)
connected_down_ipv6 (ifp, ifc);
-#endif /* HAVE_IPV6 */
}
}
- /* Examine all static routes which direct to the interface. */
rib_update ();
+#endif /* HAVE_IPV6 */
}
void
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index a4fa261b..24975f71 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -342,6 +342,7 @@ static int
nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
struct route_node *top)
{
+ struct interface *ifp;
struct prefix_ipv4 p;
struct route_table *table;
struct route_node *rn;
@@ -398,7 +399,16 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
newhop = match->nexthop;
if (newhop && nexthop->type == NEXTHOP_TYPE_IPV4)
nexthop->ifindex = newhop->ifindex;
-
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFINDEX)
+ {
+ ifp = if_lookup_by_index (newhop->ifindex);
+ return (ifp && if_is_operative (ifp));
+ }
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFNAME)
+ {
+ ifp = if_lookup_by_name(newhop->ifname);
+ return (ifp && if_is_operative (ifp));
+ }
return 1;
}
else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL))
@@ -419,6 +429,17 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
|| newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
nexthop->rifindex = newhop->ifindex;
}
+
+ if (newhop->type == NEXTHOP_TYPE_IFINDEX)
+ {
+ ifp = if_lookup_by_index (newhop->ifindex);
+ return (ifp && if_is_operative (ifp));
+ }
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFNAME)
+ {
+ ifp = if_lookup_by_name(newhop->ifname);
+ return (ifp && if_is_operative (ifp));
+ }
return 1;
}
return 0;
@@ -439,6 +460,7 @@ static int
nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
struct route_node *top)
{
+ struct interface *ifp;
struct prefix_ipv6 p;
struct route_table *table;
struct route_node *rn;
@@ -496,7 +518,17 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
if (newhop && nexthop->type == NEXTHOP_TYPE_IPV6)
nexthop->ifindex = newhop->ifindex;
-
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFINDEX)
+ {
+ ifp = if_lookup_by_index (newhop->ifindex);
+ return (ifp && if_is_operative (ifp));
+ }
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFNAME)
+ {
+ ifp = if_lookup_by_name(newhop->ifname);
+ return (ifp && if_is_operative (ifp));
+ }
+
return 1;
}
else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL))
@@ -519,6 +551,17 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
|| newhop->type == NEXTHOP_TYPE_IPV6_IFNAME)
nexthop->rifindex = newhop->ifindex;
}
+
+ if (newhop && newhop->type == NEXTHOP_TYPE_IFINDEX)
+ {
+ ifp = if_lookup_by_index (newhop->ifindex);
+ return (ifp && if_is_operative (ifp));
+ }
+ else if (newhop && newhop->type == NEXTHOP_TYPE_IFNAME)
+ {
+ ifp = if_lookup_by_name(newhop->ifname);
+ return (ifp && if_is_operative (ifp));
+ }
return 1;
}
return 0;