diff --git a/ext/bin/tap-windows/x64/zttap200.cat b/ext/bin/tap-windows/x64/zttap200.cat index 211ffff37..a3769e405 100644 Binary files a/ext/bin/tap-windows/x64/zttap200.cat and b/ext/bin/tap-windows/x64/zttap200.cat differ diff --git a/ext/bin/tap-windows/x64/zttap200.inf b/ext/bin/tap-windows/x64/zttap200.inf index 9dd9c406e..dc1a74227 100644 --- a/ext/bin/tap-windows/x64/zttap200.inf +++ b/ext/bin/tap-windows/x64/zttap200.inf @@ -4,7 +4,7 @@ Class=Net ClassGuid={4d36e972-e325-11ce-bfc1-08002be10318} Provider=%Provider% CatalogFile=zttap200.cat -DriverVer=01/22/2014,22.4.22.918 +DriverVer=01/23/2014,15.19.17.816 [Strings] DeviceDescription = "ZeroTier One Virtual Network Port" diff --git a/ext/bin/tap-windows/x64/zttap200.sys b/ext/bin/tap-windows/x64/zttap200.sys index b17cbce7b..339351fb3 100644 Binary files a/ext/bin/tap-windows/x64/zttap200.sys and b/ext/bin/tap-windows/x64/zttap200.sys differ diff --git a/node/EthernetTap.cpp b/node/EthernetTap.cpp index 47355cbcb..81cf5c4fb 100644 --- a/node/EthernetTap.cpp +++ b/node/EthernetTap.cpp @@ -1385,7 +1385,8 @@ void EthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const char *d = _injectPending.back().first.data; memcpy(d,to.data,6); memcpy(d + 6,from.data,6); - *((uint16_t *)(d + 12)) = Utils::hton(etherType); + d[12] = (char)((etherType >> 8) & 0xff); + d[13] = (char)(etherType & 0xff); memcpy(d + 14,data,len); } @@ -1475,7 +1476,6 @@ void EthernetTap::threadMain() MAC from(_tapReadBuf + 6); unsigned int etherType = Utils::ntoh(*((const uint16_t *)(_tapReadBuf + 12))); Buffer<4096> tmp(_tapReadBuf + 14,bytesRead - 14); - //printf("GOT FRAME: %u bytes: %s\r\n",(unsigned int)bytesRead,Utils::hex(_tapReadBuf,bytesRead).c_str()); _handler(_arg,from,to,etherType,tmp); } } diff --git a/windows/TapDriver/tapdrvr.c b/windows/TapDriver/tapdrvr.c index f541ebd77..d638cdf6e 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",