Index: zebra/rib.c =================================================================== RCS file: /cvsroot/zebra/zebra/rib.c,v retrieving revision 1.167 diff -u -r1.167 rib.c --- zebra/rib.c 1 Feb 2001 19:41:26 -0000 1.167 +++ zebra/rib.c 7 Jul 2001 10:09:41 -0000 @@ -233,6 +233,7 @@ struct route_node *rn; struct rib *match; struct nexthop *newhop; + struct interface *ifp; if (nexthop->type == NEXTHOP_TYPE_IPV4) nexthop->ifindex = 0; @@ -303,6 +304,22 @@ } return 0; } + else if (match->nexthop && match->nexthop->type == ZEBRA_NEXTHOP_IFINDEX) { + nexthop->ifindex = match->nexthop->ifindex; + + return 1; + } + else if (match->nexthop && match->nexthop->type == ZEBRA_NEXTHOP_IFNAME) + { + ifp = if_lookup_by_name (match->nexthop->ifname); + if (ifp && if_is_up (ifp)) + { + nexthop->ifindex = ifp->ifindex; + return 1; + } + + return 0; + } else { return 0; @@ -323,6 +340,7 @@ struct route_node *rn; struct rib *match; struct nexthop *newhop; + struct interface *ifp; if (nexthop->type == NEXTHOP_TYPE_IPV6) nexthop->ifindex = 0; @@ -394,6 +412,23 @@ } return 1; } + return 0; + } + else if (match->nexthop && match->nexthop->type == ZEBRA_NEXTHOP_IFINDEX) + { + nexthop->ifindex = match->nexthop->ifindex; + + return 1; + } + else if (match->nexthop && match->nexthop->type == ZEBRA_NEXTHOP_IFNAME) + { + ifp = if_lookup_by_name (match->nexthop->ifname); + if (ifp && if_is_up (ifp)) + { + nexthop->ifindex = ifp->ifindex; + return 1; + } + return 0; } else