[ovs-dev] [PATCH 6/6] datapath-windows: loop iterator fixes in Vport.c

Nithin Raju nithin at vmware.com
Mon Oct 13 03:56:19 UTC 2014


Validation:
- With these fixes, we no longer see the freeze during module
uninstallation or when we try to add a new port.
- We are able to add a port called "internal of type internal using:
ovs-dpctl.exe add-if ovs-system internal,type=internal

Signed-off-by: Nithin Raju <nithin at vmware.com>
---
 datapath-windows/ovsext/Vport.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index 9dfbf51..0522cfd 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -512,16 +512,17 @@ OvsFindVportByHvName(POVS_SWITCH_CONTEXT switchContext,
     /* 'portFriendlyName' is not NUL-terminated. */
     SIZE_T length = strlen(name);
     SIZE_T wstrSize = length * sizeof(WCHAR);
+    UINT i;
 
     PWSTR wsName = OvsAllocateMemory(wstrSize);
     if (!wsName) {
         return NULL;
     }
-    for (UINT i = 0; i < length; i) {
+    for (i = 0; i < length; i++) {
         wsName[i] = name[i];
     }
 
-    for (UINT32 i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i) {
+    for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) {
         head = &(switchContext->portIdHashArray[i]);
         LIST_FORALL(head, link) {
             vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink);
@@ -912,7 +913,7 @@ cleanup:
 VOID
 OvsClearAllSwitchVports(POVS_SWITCH_CONTEXT switchContext)
 {
-    for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash) {
+    for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) {
         PLIST_ENTRY head, link, next;
 
         head = &(switchContext->portIdHashArray[hash & OVS_VPORT_MASK]);
-- 
1.7.4.1




More information about the dev mailing list