datapath-windows: remove vport from lists upon deletion
authorNithin Raju <nithin@vmware.com>
Mon, 13 Oct 2014 03:56:16 +0000 (20:56 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Oct 2014 21:01:30 +0000 (14:01 -0700)
In this patch, we fix a bug in the vport delete code. When a vport is
deleted using a netlink command, we need to remove it from the
'ovsNamHashArray' and the 'portNoHashArray' as well. Addition of a vport
adds the port to the lists.

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/Datapath.c

index 19c0834..6c78ab8 100644 (file)
@@ -1967,6 +1967,8 @@ OvsDeleteVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
          * Instead, we mark the datapath (ovs) part of the vport as
          * "not created", i.e. we set vport->portNo = OVS_PORT_NUMBER_INVALID.
         */
+        RemoveEntryList(&vport->ovsNameLink);
+        RemoveEntryList(&vport->portNoLink);
         vport->portNo = OVS_DPPORT_NUMBER_INVALID;
         vport->ovsName[0] = '\0';
     }