]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Set isActivated flag only on success
authorShashank Ram <rams@vmware.com>
Mon, 10 Oct 2016 22:15:05 +0000 (15:15 -0700)
committerGurucharan Shetty <guru@ovn.org>
Mon, 31 Oct 2016 17:04:01 +0000 (10:04 -0700)
@Switch.c: Modifies OvsActivateSwitch() function
to mark the switch as activated only if the
the status is success. The callers itself
only call this method when the isActivated
flag is unset.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
datapath-windows/ovsext/Switch.c

index 825fa3c8fcba498123bdc0d52254e1b431826c2f..49711a9efe139bd21233b7185dd77f9e53ba58f2 100644 (file)
@@ -556,7 +556,6 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
     OVS_LOG_TRACE("Enter: activate switch %p, dpNo: %ld",
                   switchContext, switchContext->dpNo);
 
-    switchContext->isActivated = TRUE;
     status = OvsAddConfiguredSwitchPorts(switchContext);
 
     if (status != NDIS_STATUS_SUCCESS) {
@@ -572,11 +571,9 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
         goto cleanup;
     }
 
-cleanup:
-    if (status != NDIS_STATUS_SUCCESS) {
-        switchContext->isActivated = TRUE;
-    }
+    switchContext->isActivated = TRUE;
 
+cleanup:
     OVS_LOG_TRACE("Exit: activate switch:%p, isActivated: %s, status = %lx",
                   switchContext,
                   (switchContext->isActivated ? "TRUE" : "FALSE"), status);