From 4f237687ce4c0b7085733d808829fd4b83cf3483 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 21 Jun 2016 13:54:03 -0700 Subject: Route management now works on Windows, including default route override! 1.1.6 very close! --- service/OneService.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'service/OneService.cpp') diff --git a/service/OneService.cpp b/service/OneService.cpp index 0825705f..8b27ba49 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1051,7 +1051,12 @@ public: } if (syncRoutes) { - const std::string tapdev(n.tap->deviceName()); + char tapdev[64]; +#ifdef __WINDOWS__ + Utils::snprintf(tapdev,sizeof(tapdev),"%.16llx",(unsigned long long)n.tap->luid().Value); +#else + Utils::scopy(tapdev,sizeof(tapdev),n.tap->deviceName().c_str()); +#endif // Nuke applied routes that are no longer in n.config.routes[] and/or are not allowed for(std::list::iterator mr(n.managedRoutes.begin());mr!=n.managedRoutes.end();) { @@ -1106,7 +1111,7 @@ public: // Add and apply new routes n.managedRoutes.push_back(ManagedRoute()); - if (!n.managedRoutes.back().set(*target,*via,tapdev.c_str())) + if (!n.managedRoutes.back().set(*target,*via,tapdev)) n.managedRoutes.pop_back(); } } -- cgit v1.2.3