summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 184b42a0..74c977a9 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -48,8 +48,7 @@ if_zebra_new_hook (struct interface *ifp)
{
struct zebra_if *zebra_if;
- zebra_if = XMALLOC (MTYPE_TMP, sizeof (struct zebra_if));
- memset (zebra_if, 0, sizeof (struct zebra_if));
+ zebra_if = XCALLOC (MTYPE_TMP, sizeof (struct zebra_if));
zebra_if->multicast = IF_ZEBRA_MULTICAST_UNSPEC;
zebra_if->shutdown = IF_ZEBRA_SHUTDOWN_UNSPEC;
@@ -274,7 +273,7 @@ if_addr_wakeup (struct interface *ifp)
/* Address check. */
if (p->family == AF_INET)
{
- if (! if_is_up (ifp))
+ if (! if_is_operative (ifp))
{
/* XXX: WTF is it trying to set flags here?
* caller has just gotten a new interface, has been
@@ -311,7 +310,7 @@ if_addr_wakeup (struct interface *ifp)
#ifdef HAVE_IPV6
if (p->family == AF_INET6)
{
- if (! if_is_up (ifp))
+ if (! if_is_operative (ifp))
{
/* XXX: See long comment above */
if_set_flags (ifp, IFF_UP | IFF_RUNNING);
@@ -379,7 +378,7 @@ if_delete_update (struct interface *ifp)
zebra_if = ifp->info;
- if (if_is_up(ifp))
+ if (if_is_operative(ifp))
{
zlog_err ("interface %s index %d is still up while being deleted.",
ifp->name, ifp->ifindex);
@@ -538,15 +537,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
@@ -822,6 +831,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
#endif /* HAVE_NET_RT_IFLIST */
}
+#if 0
/* Check supported address family. */
static int
if_supported_family (int family)
@@ -834,6 +844,7 @@ if_supported_family (int family)
#endif /* HAVE_IPV6 */
return 0;
}
+#endif
/* Wrapper hook point for zebra daemon so that ifindex can be set
* DEFUN macro not used as extract.pl HAS to ignore this
@@ -1205,7 +1216,7 @@ ip_address_install (struct vty *vty, struct interface *ifp,
&& CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
/* Some system need to up the interface to set IP address. */
- if (! if_is_up (ifp))
+ if (! if_is_operative (ifp))
{
if_set_flags (ifp, IFF_UP | IFF_RUNNING);
if_refresh (ifp);
@@ -1398,7 +1409,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp,
&& CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
/* Some system need to up the interface to set IP address. */
- if (! if_is_up (ifp))
+ if (! if_is_operative (ifp))
{
if_set_flags (ifp, IFF_UP | IFF_RUNNING);
if_refresh (ifp);