}
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;
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;
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);