summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-08-08 14:08:35 -0500
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-08-08 14:08:35 -0500
commit8b97755fc51cd57ca7e5a214a86bde8c03aba70b (patch)
treefc09735c28d345550bd4baa9e964ce70c1d08f48 /service
parent7bb0d9be1b2606a77c9f4e5f5c599ca5c7ff2fb6 (diff)
downloadinfinitytier-8b97755fc51cd57ca7e5a214a86bde8c03aba70b.tar.gz
infinitytier-8b97755fc51cd57ca7e5a214a86bde8c03aba70b.zip
Windows fixes.
Diffstat (limited to 'service')
-rw-r--r--service/OneService.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp
index b38e8f42..93e97bde 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -101,6 +101,9 @@ using json = nlohmann::json;
#include "../controller/EmbeddedNetworkController.hpp"
#include "../controller/RabbitMQ.hpp"
#include "../osdep/EthernetTap.hpp"
+#ifdef __WINDOWS__
+#include "../osdep/WindowsEthernetTap.hpp"
+#endif
#ifndef ZT_SOFTWARE_UPDATE_DEFAULT
#define ZT_SOFTWARE_UPDATE_DEFAULT "disable"
@@ -1741,7 +1744,7 @@ public:
if (syncRoutes) {
char tapdev[64];
#if defined(__WINDOWS__) && !defined(ZT_SDK)
- OSUtils::ztsnprintf(tapdev,sizeof(tapdev),"%.16llx",(unsigned long long)n.tap->luid().Value);
+ OSUtils::ztsnprintf(tapdev,sizeof(tapdev),"%.16llx",(unsigned long long)((WindowsEthernetTap *)(n.tap.get()))->luid().Value);
#else
Utils::scopy(tapdev,sizeof(tapdev),n.tap->deviceName().c_str());
#endif
@@ -2167,7 +2170,7 @@ public:
// without WindowsEthernetTap::isInitialized() returning true, the won't actually
// be online yet and setting managed routes on it will fail.
const int MAX_SLEEP_COUNT = 500;
- for (int i = 0; !n.tap->isInitialized() && i < MAX_SLEEP_COUNT; i++) {
+ for (int i = 0; !((WindowsEthernetTap *)(n.tap.get()))->isInitialized() && i < MAX_SLEEP_COUNT; i++) {
Sleep(10);
}
#endif
@@ -2183,7 +2186,7 @@ public:
case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY:
if (n.tap) { // sanity check
#if defined(__WINDOWS__) && !defined(ZT_SDK)
- std::string winInstanceId(n.tap->instanceId());
+ std::string winInstanceId(((WindowsEthernetTap *)(n.tap.get()))->instanceId());
#endif
*nuptr = (void *)0;
n.tap.reset();