diff options
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/interface.c | 16 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 40 |
2 files changed, 33 insertions, 23 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 7a6c7050..24975f71 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; } |