When userspace tries to resubscribe to an existing queue, return
STATUS_INVALID_PARAMETER since it's not supported. The current bug
overwrites status to STATUS_SUCCESS.

The second bug fix is around releasing the EventQueue lock if an open
instance couldn't be found. The current version returns back without
releasing the lock. Moving the OvsAcquireEventQueueLock() after the
instance is verified.

Signed-off-by: Sairam Venugopal <vsai...@vmware.com>
---
 datapath-windows/ovsext/Event.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/datapath-windows/ovsext/Event.c b/datapath-windows/ovsext/Event.c
index 8c7c3ec..8ff0322 100644
--- a/datapath-windows/ovsext/Event.c
+++ b/datapath-windows/ovsext/Event.c
@@ -217,9 +217,8 @@ OvsSubscribeEventIoctl(PFILE_OBJECT fileObject,
         if (queue->mask != request->mask) {
             status = STATUS_INVALID_PARAMETER;
             OVS_LOG_WARN("Can not chnage mask when the queue is subscribed");
+            goto done_event_subscribe;
         }
-        status = STATUS_SUCCESS;
-        goto done_event_subscribe;
     } else if (!request->subscribe && queue == NULL) {
         status = STATUS_SUCCESS;
         goto done_event_subscribe;
@@ -356,8 +355,6 @@ OvsWaitEventIoctl(PIRP irp,
     }
     poll = (POVS_EVENT_POLL)inputBuffer;
 
-    OvsAcquireEventQueueLock();
-
     instance = OvsGetOpenInstance(fileObject, poll->dpNo);
     if (instance == NULL) {
         OVS_LOG_TRACE("Exit: Can not find open instance, dpNo: %d",
@@ -365,6 +362,7 @@ OvsWaitEventIoctl(PIRP irp,
         return STATUS_INVALID_PARAMETER;
     }
 
+    OvsAcquireEventQueueLock();
     queue = (POVS_EVENT_QUEUE)instance->eventQueue;
     if (queue == NULL) {
         OVS_LOG_TRACE("Exit: Event queue does not exist");
-- 
2.9.0.windows.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to