summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/User.c
diff options
context:
space:
mode:
authorAnkur Sharma <ankursharma@vmware.com>2014-10-15 15:54:54 -0700
committerBen Pfaff <blp@nicira.com>2014-10-15 17:00:29 -0700
commit7c5d9f1716fb33f4316a4f81b548430bbed474f8 (patch)
tree690234978234d7d74e0bb8ff23aadf3b37dd6d82 /datapath-windows/ovsext/User.c
parentefa753a8ee4d14c426df4367edbe801fe2ec6859 (diff)
downloadopenvswitch-7c5d9f1716fb33f4316a4f81b548430bbed474f8.tar.gz
datapath-windows: Action not supported error handling
Added changes to support error handling for non supported actions. Added changes in packet execute for sending transactional errors. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Nithin Raju <nithin@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.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index 8400b83bc..f24c4e3f1 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -369,6 +369,7 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
status = OvsExecuteDpIoctl(&execute);
+ /* Default reply that we want to send */
if (status == STATUS_SUCCESS) {
NlBufInit(&nlBuf, usrParamsCtx->outputBuffer,
usrParamsCtx->outputLength);
@@ -382,20 +383,23 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
if (status == STATUS_SUCCESS) {
*replyLen = msgOut->nlMsg.nlmsgLen;
}
- }
-
- /* As of now there are no transactional errors in the implementation.
- * Once we have them then we need to map status to correct
- * nlError value, so that below mentioned code gets hit. */
- if ((nlError != NL_ERROR_SUCCESS) &&
- (usrParamsCtx->outputBuffer)) {
-
- POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)
- usrParamsCtx->outputBuffer;
- BuildErrorMsg(msgIn, msgError, nlError);
- *replyLen = msgError->nlMsg.nlmsgLen;
- status = STATUS_SUCCESS;
- goto done;
+ } else {
+ /* Map NTSTATUS to NL_ERROR */
+ nlError = NlMapStatusToNlErr(status);
+
+ /* As of now there are no transactional errors in the implementation.
+ * Once we have them then we need to map status to correct
+ * nlError value, so that below mentioned code gets hit. */
+ if ((nlError != NL_ERROR_SUCCESS) &&
+ (usrParamsCtx->outputBuffer)) {
+
+ POVS_MESSAGE_ERROR msgError = (POVS_MESSAGE_ERROR)
+ usrParamsCtx->outputBuffer;
+ BuildErrorMsg(msgIn, msgError, nlError);
+ *replyLen = msgError->nlMsg.nlmsgLen;
+ status = STATUS_SUCCESS;
+ goto done;
+ }
}
done:
@@ -487,7 +491,11 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
NdisReleaseRWLock(gOvsSwitchContext->dispatchLock, &lockState);
}
if (ndisStatus != NDIS_STATUS_SUCCESS) {
- status = STATUS_UNSUCCESSFUL;
+ if (ndisStatus == NDIS_STATUS_NOT_SUPPORTED) {
+ status = STATUS_NOT_SUPPORTED;
+ } else {
+ status = STATUS_UNSUCCESSFUL;
+ }
}
if (pNbl) {