summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/vrf.c2
-rw-r--r--zebra/interface.c22
-rw-r--r--zebra/interface.h1
-rw-r--r--zebra/main.c8
-rw-r--r--zebra/rt_netlink.c6
5 files changed, 14 insertions, 25 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index f2eb551f82..eab720fe1d 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -255,6 +255,7 @@ vrf_enable (struct vrf *vrf)
static void
vrf_disable (struct vrf *vrf)
{
+ UNSET_FLAG (vrf->status, VRF_ACTIVE);
if (vrf_is_enabled (vrf))
{
if (debug_vrf)
@@ -266,6 +267,7 @@ vrf_disable (struct vrf *vrf)
if (vrf_master.vrf_disable_hook)
(*vrf_master.vrf_disable_hook) (vrf->vrf_id, vrf->name, &vrf->info);
}
+
}
diff --git a/zebra/interface.c b/zebra/interface.c
index b47d03929f..cd5f1d9f0d 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -739,28 +739,6 @@ vrf_add_update (struct vrf *vrfp)
}
}
-/* Handle an interface delete event */
-void
-vrf_delete_update (struct vrf *vrfp)
-{
- /* Mark VRF as inactive */
- UNSET_FLAG (vrfp->status, VRF_ACTIVE);
-
- if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug ("VRF %s id %u is now inactive.",
- vrfp->name, vrfp->vrf_id);
-
- zebra_vrf_delete_update (vrf_info_lookup (vrfp->vrf_id));
-
- /* Pending: Update ifindex after distributing the delete message. This is in
- case any client needs to have the old value of ifindex available
- while processing the deletion. Each client daemon is responsible
- for setting vrf-id to IFINDEX_INTERNAL after processing the
- interface deletion message. */
- vrfp->vrf_id = VRF_UNKNOWN;
-}
-
-
static void
ipv6_ll_address_to_mac (struct in6_addr *address, u_char *mac)
{
diff --git a/zebra/interface.h b/zebra/interface.h
index 8e8387eaf4..9beabb62f8 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -233,7 +233,6 @@ extern int if_subnet_delete (struct interface *, struct connected *);
extern int ipv6_address_configured (struct interface *ifp);
extern void if_handle_vrf_change (struct interface *ifp, vrf_id_t vrf_id);
-extern void vrf_delete_update (struct vrf *vrfp);
extern void vrf_add_update (struct vrf *vrfp);
#ifdef HAVE_PROC_NET_DEV
diff --git a/zebra/main.c b/zebra/main.c
index ea3aee659c..eb46aad6ca 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -297,6 +297,14 @@ zebra_ns_disable (ns_id_t ns_id, void **info)
static int
zebra_vrf_disable (vrf_id_t vrf_id, const char *name, void **info)
{
+ struct zebra_vrf *zvrf = (struct zebra_vrf *)(*info);
+
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug ("VRF %s id %u is now disabled.",
+ zvrf->name, zvrf->vrf_id);
+
+ zebra_vrf_delete_update (zvrf);
+
return 0;
}
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 5686d8e528..41db582df4 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -584,9 +584,11 @@ netlink_vrf_change (struct nlmsghdr *h, struct rtattr *tb, const char *name)
vrf = vrf_lookup ((vrf_id_t)ifi->ifi_index);
if (!vrf)
- zlog_warn ("%s: vrf not found", __func__);
+ {
+ zlog_warn ("%s: vrf not found", __func__);
+ return;
+ }
- vrf_delete_update (vrf);
vrf_delete (vrf);
}
}