datapath-windows: loop iterator fixes in Vport.c
authorNithin Raju <nithin@vmware.com>
Mon, 13 Oct 2014 03:56:19 +0000 (20:56 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Oct 2014 21:01:40 +0000 (14:01 -0700)
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@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/Vport.c

index 9dfbf51..0522cfd 100644 (file)
@@ -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]);