diff options
author | Nithin Raju <nithin@vmware.com> | 2014-12-08 09:43:13 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-12-11 16:43:52 -0800 |
commit | 1ad44ad455e4f2f96eb98d8b3faf06f3e358c214 (patch) | |
tree | 20a654a087513ec6c4e46809920aa2c5d0879c03 /datapath-windows/ovsext/User.c | |
parent | 5fc8ea2d6f0e604cad53e48164d64f0edcf43204 (diff) | |
download | openvswitch-1ad44ad455e4f2f96eb98d8b3faf06f3e358c214.tar.gz |
datapath-windows: return bool from NlFillOvs[Msg/Hdr]
Per review comment, in this patch, we update the return values of
NlFillOvsMsg() and NlFillOvsHdr() from NTSTATUS to BOOLEAN to make them
consistent with the Nl* functions.
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/User.c')
-rw-r--r-- | datapath-windows/ovsext/User.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index 70091cbe6..d8a657e32 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -375,17 +375,21 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, /* Default reply that we want to send */ if (status == STATUS_SUCCESS) { + BOOLEAN ok; + NlBufInit(&nlBuf, usrParamsCtx->outputBuffer, usrParamsCtx->outputLength); /* Prepare nl Msg headers */ - status = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0, + ok = NlFillOvsMsg(&nlBuf, nlMsgHdr->nlmsgType, 0, nlMsgHdr->nlmsgSeq, nlMsgHdr->nlmsgPid, genlMsgHdr->cmd, OVS_PACKET_VERSION, ovsHdr->dp_ifindex); - if (status == STATUS_SUCCESS) { + if (ok) { *replyLen = msgOut->nlMsg.nlmsgLen; + } else { + status = STATUS_INVALID_BUFFER_SIZE; } } else { /* Map NTSTATUS to NL_ERROR */ @@ -1088,9 +1092,9 @@ OvsCreateQueueNlPacket(PVOID userData, * Since we are pre allocating memory for the NL buffer * the attribute settings should not fail */ - if (NlFillOvsMsg(&nlBuf, OVS_WIN_NL_PACKET_FAMILY_ID, 0, + if (!NlFillOvsMsg(&nlBuf, OVS_WIN_NL_PACKET_FAMILY_ID, 0, 0, pid, (UINT8)cmd, OVS_PACKET_VERSION, - gOvsSwitchContext->dpNo) != STATUS_SUCCESS) { + gOvsSwitchContext->dpNo)) { goto fail; } |