Skip to content

Commit

Permalink
datapath-windows: event read should not fail when no events
Browse files Browse the repository at this point in the history
The semantics are read operation are generally to return 0 bytes and
STATUS_SUCCESS when there are no events.

Also, added a fix to assign the PID to the synthetic OVS_MESSAGE formed
for the command validation.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
nithinrajub authored and blp committed Oct 21, 2014
1 parent 72d5216 commit deda30a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datapath-windows/ovsext/Datapath.c
Expand Up @@ -740,6 +740,7 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject,

ovsMsg = &ovsMsgReadOp;
ovsMsg->nlMsg.nlmsgType = OVS_WIN_NL_CTRL_FAMILY_ID;
ovsMsg->nlMsg.nlmsgPid = instance->pid;
/* An "artificial" command so we can use NL family function table*/
ovsMsg->genlMsg.cmd = (code == OVS_IOCTL_READ_EVENT) ?
OVS_CTRL_CMD_EVENT_NOTIFY :
Expand Down Expand Up @@ -2301,6 +2302,9 @@ OvsReadEventCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
/* remove an event entry from the event queue */
status = OvsRemoveEventEntry(usrParamsCtx->ovsInstance, &eventEntry);
if (status != STATUS_SUCCESS) {
/* If there were not elements, read should return no data. */
status = STATUS_SUCCESS;
*replyLen = 0;
goto cleanup;
}

Expand Down

0 comments on commit deda30a

Please sign in to comment.