From d6e8a5f3ca2ecc78c5c8542356099912cbffb552 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 30 Jan 2018 16:07:41 -0800 Subject: Fix Windows compile error. --- osdep/WindowsEthernetTap.cpp | 7 ++++--- osdep/WindowsEthernetTap.hpp | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'osdep') diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp index 22b81454..64ab3943 100644 --- a/osdep/WindowsEthernetTap.cpp +++ b/osdep/WindowsEthernetTap.cpp @@ -795,8 +795,9 @@ void WindowsEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherTyp return; Mutex::Lock _l(_injectPending_m); - _injectPending.push( std::pair,unsigned int>(Array(),len + 14) ); - char *d = _injectPending.back().first.data; + _injectPending.emplace(); + _injectPending.back().len = len + 14; + char *const d = _injectPending.back().data; to.copyTo(d,6); from.copyTo(d + 6,6); d[12] = (char)((etherType >> 8) & 0xff); @@ -1100,7 +1101,7 @@ void WindowsEthernetTap::threadMain() } else _injectPending_m.lock(); if (!_injectPending.empty()) { - WriteFile(_tap,_injectPending.front().first.data,_injectPending.front().second,NULL,&tapOvlWrite); + WriteFile(_tap,_injectPending.front().data,_injectPending.front().len,NULL,&tapOvlWrite); writeInProgress = true; } diff --git a/osdep/WindowsEthernetTap.hpp b/osdep/WindowsEthernetTap.hpp index 856c3be7..1e36bdd8 100644 --- a/osdep/WindowsEthernetTap.hpp +++ b/osdep/WindowsEthernetTap.hpp @@ -38,7 +38,6 @@ #include "../node/Constants.hpp" #include "../node/Mutex.hpp" -#include "../node/Array.hpp" #include "../node/MulticastGroup.hpp" #include "../node/InetAddress.hpp" #include "../osdep/Thread.hpp" @@ -150,7 +149,12 @@ private: std::vector _multicastGroups; - std::queue< std::pair< Array,unsigned int > > _injectPending; + struct _InjectPending + { + unsigned int len; + char data[ZT_MAX_MTU + 32]; + }; + std::queue<_InjectPending> _injectPending; Mutex _injectPending_m; std::string _pathToHelpers; -- cgit v1.2.3