summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-03-22 22:03:04 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-03-23 13:30:08 +0100
commit2878e4dff6fa9b4c2b1b99fc56b889985e65ad66 (patch)
treec2ed127d234063dfbe50d9f3d5f2b7d2103de7f6 /zebra
parentzebra: Replace vrf with zebra_vrf in a few places (diff)
downloadfrr-2878e4dff6fa9b4c2b1b99fc56b889985e65ad66.tar.xz
frr-2878e4dff6fa9b4c2b1b99fc56b889985e65ad66.zip
zebra: Some small modifications to actually delete the vrf
zebra was not actually deleting the vrf passed in. Ticket: CM-9412 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/main.c9
-rw-r--r--zebra/rt_netlink.c5
2 files changed, 12 insertions, 2 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 3590eed26..b3571c26f 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -297,6 +297,12 @@ 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)
{
+ return 0;
+}
+
+static int
+zebra_vrf_delete (vrf_id_t vrf_id, const char *name, void **info)
+{
struct zebra_vrf *zvrf = (struct zebra_vrf *) (*info);
struct listnode *list_node;
struct interface *ifp;
@@ -317,6 +323,8 @@ zebra_vrf_disable (vrf_id_t vrf_id, const char *name, void **info)
list_delete_all_node (zvrf->rid_all_sorted_list);
list_delete_all_node (zvrf->rid_lo_sorted_list);
+ XFREE (MTYPE_ZEBRA_VRF, zvrf);
+
return 0;
}
@@ -329,6 +337,7 @@ zebra_vrf_init (void)
vrf_add_hook (VRF_NEW_HOOK, zebra_vrf_new);
vrf_add_hook (VRF_ENABLE_HOOK, zebra_vrf_enable);
vrf_add_hook (VRF_DISABLE_HOOK, zebra_vrf_disable);
+ vrf_add_hook (VRF_DELETE_HOOK, zebra_vrf_delete);
/* Default NS initialization */
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 6258c4bf6..ffab76bbe 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -581,7 +581,8 @@ netlink_vrf_change (struct nlmsghdr *h, struct rtattr *tb, const char *name)
if (!vrf)
zlog_warn ("%s: vrf not found", __func__);
- vrf_delete_update(vrf);
+ vrf_delete_update (vrf);
+ vrf_delete (vrf);
}
}
@@ -1528,7 +1529,7 @@ rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen)
len = RTA_LENGTH (alen);
- if (RTA_ALIGN (rta->rta_len) + len > maxlen)
+ if ((int)RTA_ALIGN (rta->rta_len) + len > maxlen)
return -1;
subrta = (struct rtattr *) (((char *) rta) + RTA_ALIGN (rta->rta_len));