Skip to content

Commit

Permalink
datapath-windows: Enable failure after restarting extension
Browse files Browse the repository at this point in the history
If the extension was previously enabled and running, after issuing a
restart, stop+start, the extension fails to be enabled. This happens
because the extension's DeviceObject is not yet initialized before the
FilterAttach routine is called.

This patch addresses this issue.

Signed-off-by: Sorin Vinturis <[email protected]>
Reported-by: Sorin Vinturis <[email protected]>
Reported-at: openvswitch/ovs-issues#96
Acked-by: Nithin Raju <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
svinturis authored and blp committed Aug 28, 2015
1 parent 21a719d commit 32e35d7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions datapath-windows/ovsext/TunnelFilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,20 +825,24 @@ OvsInitTunnelFilter(PDRIVER_OBJECT driverObject, PVOID deviceObject)
{
NTSTATUS status = STATUS_SUCCESS;

status = OvsSubscribeTunnelInitBfeStateChanges(driverObject, deviceObject);
if (NT_SUCCESS(status)) {
if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) {
status = OvsTunnelFilterInitialize(driverObject);
if (!NT_SUCCESS(status)) {
/* XXX: We need to decide what actions to take in case of
* failure to initialize tunnel filter. */
ASSERT(status == NDIS_STATUS_SUCCESS);
OVS_LOG_ERROR(
"Failed to initialize tunnel filter, status: %x.",
status);
if (deviceObject) {
status = OvsSubscribeTunnelInitBfeStateChanges(driverObject, deviceObject);
if (NT_SUCCESS(status)) {
if (FWPM_SERVICE_RUNNING == FwpmBfeStateGet()) {
status = OvsTunnelFilterInitialize(driverObject);
if (!NT_SUCCESS(status)) {
/* XXX: We need to decide what actions to take in case of
* failure to initialize tunnel filter. */
ASSERT(status == NDIS_STATUS_SUCCESS);
OVS_LOG_ERROR(
"Failed to initialize tunnel filter, status: %x.",
status);
}
OvsUnsubscribeTunnelInitBfeStateChanges();
}
OvsUnsubscribeTunnelInitBfeStateChanges();
}
} else {
status = OvsTunnelFilterInitialize(driverObject);
}

return status;
Expand Down

0 comments on commit 32e35d7

Please sign in to comment.