There are cases when the WFP callout or sublayer, being persistent
objects, already exists when we try to register the OVS callout. In
this cases, when trying to add again these WFP objects the return code
is STATUS_FWP_ALREADY_EXISTS, which we are interpreting as an error.
This is incorrect and this patch changes that.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/84
Signed-off-by: Ben Pfaff <blp@nicira.com>
status = FwpmCalloutAdd(gEngineHandle, &mCallout, NULL, NULL);
if (!NT_SUCCESS(status)) {
status = FwpmCalloutAdd(gEngineHandle, &mCallout, NULL, NULL);
if (!NT_SUCCESS(status)) {
+ if (STATUS_FWP_ALREADY_EXISTS != status) {
+ OVS_LOG_ERROR("Failed to add WFP callout, status: %x.",
+ status);
+ goto Exit;
+ }
+ status = STATUS_SUCCESS;
status = FwpmSubLayerAdd(gEngineHandle, &OvsTunnelSubLayer, NULL);
if (!NT_SUCCESS(status)) {
status = FwpmSubLayerAdd(gEngineHandle, &OvsTunnelSubLayer, NULL);
if (!NT_SUCCESS(status)) {
+ if (STATUS_FWP_ALREADY_EXISTS != status) {
+ OVS_LOG_ERROR("Failed to add WFP sublayer, status: %x.",
+ status);
+ goto Exit;
+ }
}
/* In order to use this callout a socket must be opened. */
}
/* In order to use this callout a socket must be opened. */