summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2016-11-28 14:26:31 +0000
committerGurucharan Shetty <guru@ovn.org>2016-11-29 10:54:26 -0800
commit50da3c736c7b97e1ef07bf57da67da92f5f81312 (patch)
tree4d741ad0a6dc79fecde408064a4af245385c1ab2
parent09995ba1240576ff028721d90432923588e585a0 (diff)
downloadopenvswitch-50da3c736c7b97e1ef07bf57da67da92f5f81312.tar.gz
datapath-windows: conntrack leaks
All conntrack entries should be removed before unloading/disabling the driver. This patch forces a flush of all the entries during the cleanup routine. The bug was found using driver verifier. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
-rw-r--r--datapath-windows/ovsext/Conntrack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
index 56a7cbc82..f48278396 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -42,6 +42,8 @@ static PNDIS_RW_LOCK_EX ovsConntrackLockObj;
extern POVS_SWITCH_CONTEXT gOvsSwitchContext;
static UINT64 ctTotalEntries;
+static __inline NDIS_STATUS OvsCtFlush(UINT16 zone);
+
/*
*----------------------------------------------------------------------------
* OvsInitConntrack
@@ -117,6 +119,9 @@ OvsCleanupConntrack(VOID)
KernelMode, FALSE, NULL);
ObDereferenceObject(ctThreadCtx.threadObject);
+ /* Force flush all entries before removing */
+ OvsCtFlush(0);
+
if (ovsConntrackTable) {
OvsFreeMemoryWithTag(ovsConntrackTable, OVS_CT_POOL_TAG);
ovsConntrackTable = NULL;