From ca07d7c2736c299f8d53abb5618a189277286658 Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Fri, 10 Apr 2015 05:43:06 +0200 Subject: [PATCH] Implement vr_host_interface_exit Before this patch the function was there but did nothing. Closes-Bug: #1463736 Change-Id: I1092b097440684a3c016dcd1d06aa3f9ef8d495c --- host/vr_host_interface.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/host/vr_host_interface.c b/host/vr_host_interface.c index dd89351db..e52410846 100644 --- a/host/vr_host_interface.c +++ b/host/vr_host_interface.c @@ -194,7 +194,7 @@ vr_hinterface_create(unsigned int index, unsigned int hif_type, hif = calloc(sizeof(*hif), 1); if (!hif) return NULL; - + switch (hif_type) { case HIF_TYPE_UDP: ret = vr_hif_udp_create(hif, vif_type); @@ -356,7 +356,14 @@ vr_host_vif_init(struct vrouter *router) void vr_host_interface_exit(void) { - return; + struct vr_hinterface *hif; + int i; + + for (i = 0; i < HIF_MAX_INTERFACES; i++) { + hif = hif_table[i]; + if (hif) + vr_hinterface_delete(hif); + } } struct vr_host_interface_ops *