summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--datapath-windows/include/OvsPub.h8
-rw-r--r--datapath-windows/ovsext/User.c22
-rw-r--r--datapath-windows/ovsext/User.h4
3 files changed, 8 insertions, 26 deletions
diff --git a/datapath-windows/include/OvsPub.h b/datapath-windows/include/OvsPub.h
index 14a1f3d58..dd42d3365 100644
--- a/datapath-windows/include/OvsPub.h
+++ b/datapath-windows/include/OvsPub.h
@@ -429,12 +429,8 @@ typedef struct OvsPacketExecute {
uint32_t packetLen;
uint32_t actionsLen;
- union {
- /* Variable size blob with packet data first, followed by action
- * attrs. */
- char packetBuf[0];
- NL_ATTR actions[0];
- };
+ PCHAR packetBuf;
+ PNL_ATTR actions;
} OvsPacketExecute;
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index f40846c18..31c579cc9 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -319,13 +319,10 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
}
NTSTATUS
-OvsExecuteDpIoctl(PVOID inputBuffer,
- UINT32 inputLength,
- UINT32 outputLength)
+OvsExecuteDpIoctl(OvsPacketExecute *execute)
{
NTSTATUS status = STATUS_SUCCESS;
NTSTATUS ndisStatus;
- OvsPacketExecute *execute;
LOCK_STATE_EX lockState;
PNET_BUFFER_LIST pNbl;
PNL_ATTR actions;
@@ -334,35 +331,26 @@ OvsExecuteDpIoctl(PVOID inputBuffer,
OVS_PACKET_HDR_INFO layers;
POVS_VPORT_ENTRY vport;
- if (inputLength < sizeof(*execute) || outputLength != 0) {
- return STATUS_INFO_LENGTH_MISMATCH;
- }
-
NdisAcquireSpinLock(gOvsCtrlLock);
if (gOvsSwitchContext == NULL) {
status = STATUS_INVALID_PARAMETER;
goto unlock;
}
- execute = (struct OvsPacketExecute *) inputBuffer;
-
if (execute->packetLen == 0) {
status = STATUS_INVALID_PARAMETER;
goto unlock;
}
- if (inputLength != sizeof (*execute) +
- execute->actionsLen + execute->packetLen) {
- status = STATUS_INFO_LENGTH_MISMATCH;
- goto unlock;
- }
- actions = (PNL_ATTR)((PCHAR)&execute->actions + execute->packetLen);
+ actions = execute->actions;
+
+ ASSERT(actions);
/*
* Allocate the NBL, copy the data from the userspace buffer. Allocate
* also, the forwarding context for the packet.
*/
- pNbl = OvsAllocateNBLForUserBuffer(gOvsSwitchContext, &execute->packetBuf,
+ pNbl = OvsAllocateNBLForUserBuffer(gOvsSwitchContext, execute->packetBuf,
execute->packetLen);
if (pNbl == NULL) {
status = STATUS_NO_MEMORY;
diff --git a/datapath-windows/ovsext/User.h b/datapath-windows/ovsext/User.h
index 5e456c74e..550915a18 100644
--- a/datapath-windows/ovsext/User.h
+++ b/datapath-windows/ovsext/User.h
@@ -104,9 +104,7 @@ NTSTATUS OvsReadDpIoctl(PFILE_OBJECT fileObject,
PVOID outputBuffer,
UINT32 outputLength,
UINT32 *replyLen);
-NTSTATUS OvsExecuteDpIoctl(PVOID inputBuffer,
- UINT32 inputLength,
- UINT32 outputLength);
+NTSTATUS OvsExecuteDpIoctl(OvsPacketExecute *execute);
NTSTATUS OvsPurgeDpIoctl(PFILE_OBJECT fileObject);
NTSTATUS OvsWaitDpIoctl(PIRP irp, PFILE_OBJECT fileObject);