diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-05 19:32:29 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-05 19:32:29 -0700 |
commit | 1dda22224848890695689def6af6ce8fa6d66397 (patch) | |
tree | 9e9957a3d71074bd6e37a131da56c282872e9e22 | |
parent | ceb9411e2a867544a745cd3eddc68f2232ed143d (diff) | |
download | quagga-1dda22224848890695689def6af6ce8fa6d66397.tar.bz2 quagga-1dda22224848890695689def6af6ce8fa6d66397.tar.xz |
Correctly identify/manage all connected static routes
Need to handle all the different flavors of connected routes
in linkstate management
Bugfix: 2904, 3416
-rw-r--r-- | zebra/zebra_rib.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 8580517a..3d3a2c8f 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -401,17 +401,24 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, { /* Directly point connected route. */ newhop = match->nexthop; - if (newhop && nexthop->type == NEXTHOP_TYPE_IPV4) - nexthop->ifindex = newhop->ifindex; - else if (newhop && newhop->type == NEXTHOP_TYPE_IFINDEX) + if (newhop) { - 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)); + if (nexthop->type == NEXTHOP_TYPE_IPV4) + nexthop->ifindex = newhop->ifindex; + + if (newhop->type == NEXTHOP_TYPE_IFINDEX || + newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) + { + ifp = if_lookup_by_index (newhop->ifindex); + return (ifp && if_is_operative (ifp)); + } + + if (newhop->type == NEXTHOP_TYPE_IFNAME || + newhop->type == NEXTHOP_TYPE_IPV4_IFNAME) + { + ifp = if_lookup_by_name(newhop->ifname); + return (ifp && if_is_operative (ifp)); + } } return 1; } |