Skip to content

Commit

Permalink
datapath-windows: loop iterator fixes in Vport.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
Tested-by: Alin Gabriel Serdean <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
nithinrajub authored and blp committed Oct 13, 2014
1 parent 5316523 commit d752e05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions datapath-windows/ovsext/Vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -912,7 +913,7 @@ OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext)
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]);
Expand Down

0 comments on commit d752e05

Please sign in to comment.