diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-04-28 10:02:25 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-04-28 10:02:25 -0700 |
commit | ccbba60205d0cf64fe12611e057d4581d40e4e22 (patch) | |
tree | 70be6e81d269506cdf8aab0107e844395a29cc45 | |
parent | e2407bd233f2397843b4bde9cd3e4bdc6d144c1b (diff) | |
download | quagga-ccbba60205d0cf64fe12611e057d4581d40e4e22.tar.bz2 quagga-ccbba60205d0cf64fe12611e057d4581d40e4e22.tar.xz |
Check nexthop status
Need to check if next hop is interface and if so then only mark
route active is interface is active. This addresses some of the problems
with static routes when interface goes down.
-rw-r--r-- | zebra/zebra_rib.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 5de320d9..27cd4fa9 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -428,17 +428,17 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, || newhop->type == NEXTHOP_TYPE_IFNAME || 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)); - } + 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; } @@ -550,17 +550,17 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX || 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)); - } + 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; } |