summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-23 16:10:24 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-23 16:10:24 -0800
commit87714181701fa92016c37937f786bbf5434ef182 (patch)
tree7fe6f11b838b381cb5ea8977de1e0369b281dca2 /windows
parent2f37ea842fc15790406d770a487725e70c1aa98c (diff)
downloadinfinitytier-87714181701fa92016c37937f786bbf5434ef182.tar.gz
infinitytier-87714181701fa92016c37937f786bbf5434ef182.zip
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!
Diffstat (limited to 'windows')
-rw-r--r--windows/TapDriver/tapdrvr.c32
1 files changed, 32 insertions, 0 deletions
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",