From 87714181701fa92016c37937f786bbf5434ef182 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 23 Jan 2014 16:10:24 -0800 Subject: Fix bug in tap driver introduced during unused code purge (deleted the part that acknowledges writes!), and fix bug in EthernetTap causing 0000 for etherType. Windows works now! Yay! --- windows/TapDriver/tapdrvr.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'windows') diff --git a/windows/TapDriver/tapdrvr.c b/windows/TapDriver/tapdrvr.c index f541ebd7..d638cdf6 100644 --- a/windows/TapDriver/tapdrvr.c +++ b/windows/TapDriver/tapdrvr.c @@ -1833,6 +1833,38 @@ NTSTATUS p_IRP->IoStatus.Status = l_Status = STATUS_UNSUCCESSFUL; p_IRP->IoStatus.Information = 0; } + else if ((l_IrpSp->Parameters.Write.Length) >= ETHERNET_HEADER_SIZE) + { + __try + { + p_IRP->IoStatus.Information = l_IrpSp->Parameters.Write.Length; + + DUMP_PACKET ("IRP_MJ_WRITE ETH", + (unsigned char *) p_IRP->AssociatedIrp.SystemBuffer, + l_IrpSp->Parameters.Write.Length); + + NdisMEthIndicateReceive + (l_Adapter->m_MiniportAdapterHandle, + (NDIS_HANDLE) l_Adapter, + (PCHAR)p_IRP->AssociatedIrp.SystemBuffer, + ETHERNET_HEADER_SIZE, + (unsigned char *)p_IRP->AssociatedIrp.SystemBuffer + ETHERNET_HEADER_SIZE, + l_IrpSp->Parameters.Write.Length - ETHERNET_HEADER_SIZE, + l_IrpSp->Parameters.Write.Length - ETHERNET_HEADER_SIZE); + + NdisMEthIndicateReceiveComplete (l_Adapter->m_MiniportAdapterHandle); + + p_IRP->IoStatus.Status = l_Status = STATUS_SUCCESS; + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + DEBUGP (("[%s] NdisMEthIndicateReceive failed in IRP_MJ_WRITE\n", + NAME (l_Adapter))); + NOTE_ERROR (); + p_IRP->IoStatus.Status = l_Status = STATUS_UNSUCCESSFUL; + p_IRP->IoStatus.Information = 0; + } + } else { DEBUGP (("[%s] Bad buffer size in IRP_MJ_WRITE, len=%d\n", -- cgit v1.2.3