datapath-windows: delete ports from portIdHashArray during cleanup
authorNithin Raju <nithin@vmware.com>
Mon, 13 Oct 2014 03:56:18 +0000 (20:56 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Oct 2014 21:01:37 +0000 (14:01 -0700)
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 61fa71d..9dfbf51 100644 (file)
@@ -913,12 +913,12 @@ VOID
 OvsClearAllSwitchVports(POVS_SWITCH_CONTEXT switchContext)
 {
     for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash) {
-        PLIST_ENTRY head, link;
+        PLIST_ENTRY head, link, next;
 
-        head = &(switchContext->portNoHashArray[hash & OVS_VPORT_MASK]);
-        LIST_FORALL(head, link) {
+        head = &(switchContext->portIdHashArray[hash & OVS_VPORT_MASK]);
+        LIST_FORALL_SAFE(head, link, next) {
             POVS_VPORT_ENTRY vport;
-            vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink);
+            vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink);
             OvsRemoveAndDeleteVport(switchContext, vport);
         }
     }