Browse Source

Merge dev

Adam Ierymenko 6 years ago
parent
commit
7566d4fbab

+ 2 - 2
attic/make-linux.mk

@@ -267,8 +267,8 @@ ifeq ($(ZT_ARCHITECTURE),3)
 		override CXXFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
 		ZT_USE_ARM32_NEON_ASM_CRYPTO=0
 	else
-		override CFLAGS+=-march=armv5 -mno-unaligned-access -marm
-		override CXXFLAGS+=-march=armv5 -mno-unaligned-access -marm
+		override CFLAGS+=-march=armv5 -mno-unaligned-access -marm -fexceptions
+		override CXXFLAGS+=-march=armv5 -mno-unaligned-access -marm -fexceptions
 		ZT_USE_ARM32_NEON_ASM_CRYPTO=0
 	endif
 endif

+ 4 - 4
ext/installfiles/windows/ZeroTier One.aip

@@ -27,10 +27,10 @@
     <ROW Property="CTRLS" Value="2"/>
     <ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
     <ROW Property="Manufacturer" Value="ZeroTier, Inc."/>
-    <ROW Property="ProductCode" Value="1033:{5ADB2CD5-4478-4B41-87C5-0DEF9FEE61BD} " Type="16"/>
+    <ROW Property="ProductCode" Value="1033:{385231E0-CA34-4B86-81B5-0573FC81CB2A} " Type="16"/>
     <ROW Property="ProductLanguage" Value="1033"/>
     <ROW Property="ProductName" Value="ZeroTier One"/>
-    <ROW Property="ProductVersion" Value="1.4.4" Type="32"/>
+    <ROW Property="ProductVersion" Value="1.4.6" Type="32"/>
     <ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
     <ROW Property="RUNAPPLICATION" Value="1" Type="4"/>
     <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
@@ -64,7 +64,7 @@
     <ROW Directory="x86_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x86"/>
   </COMPONENT>
   <COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
-    <ROW Component="AI_CustomARPName" ComponentId="{6186488E-626B-4975-BE77-6EDCC27F3F4F}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
+    <ROW Component="AI_CustomARPName" ComponentId="{717E3B00-472C-4E07-BC45-AF83F5442898}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
     <ROW Component="AI_DisableModify" ComponentId="{020DCABD-5D56-49B9-AF48-F07F0B55E590}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/>
     <ROW Component="AI_ExePath" ComponentId="{8E02B36C-7A19-429B-A93E-77A9261AC918}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/>
     <ROW Component="Hardcodet.Wpf.TaskbarNotification.dll" ComponentId="{BEA825AF-2555-44AF-BE40-47FFC16DCBA6}" Directory_="APPDIR" Attributes="0" KeyPath="Hardcodet.Wpf.TaskbarNotification.dll"/>
@@ -454,7 +454,7 @@
     <ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
   </COMPONENT>
   <COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
-    <ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="4"/>
+    <ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="6"/>
     <ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false"/>
     <ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1"/>
     <ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="4"/>

+ 5 - 1
service/OneService.cpp

@@ -1165,8 +1165,8 @@ public:
 											json &allowDefault = j["allowDefault"];
 											if (allowDefault.is_boolean()) localSettings.allowDefault = (bool)allowDefault;
 										}
+									} catch (std::exception &exc) {
 									} catch ( ... ) {
-										// discard invalid JSON
 									}
 
 									setNetworkSettings(nws->networks[i].nwid,localSettings);
@@ -1632,6 +1632,8 @@ public:
 					return;
 
 			}
+		} catch (std::exception &exc) {
+			_phy.close(sock);
 		} catch ( ... ) {
 			_phy.close(sock);
 		}
@@ -1740,6 +1742,8 @@ public:
 #endif
 						_nets.erase(nwid);
 						return -999;
+					} catch (int exc) {
+						return -999;
 					} catch ( ... ) {
 						return -999; // tap init failed
 					}

+ 14 - 1
windows/ZeroTierOne/ZeroTierOne.vcxproj

@@ -113,7 +113,20 @@
     <ClCompile Include="..\..\service\SoftwareUpdater.cpp" />
     <ClCompile Include="ServiceBase.cpp" />
     <ClCompile Include="ServiceInstaller.cpp" />
-    <ClCompile Include="ZeroTierOneService.cpp" />
+    <ClCompile Include="ZeroTierOneService.cpp">
+      <FunctionLevelLinking Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</FunctionLevelLinking>
+      <EnableParallelCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EnableParallelCodeGeneration>
+      <FunctionLevelLinking Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</FunctionLevelLinking>
+      <EnableParallelCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</EnableParallelCodeGeneration>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NoExtensions</EnableEnhancedInstructionSet>
+      <FloatingPointExceptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</FloatingPointExceptions>
+      <CreateHotpatchableImage Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CreateHotpatchableImage>
+      <FloatingPointExceptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</FloatingPointExceptions>
+      <CreateHotpatchableImage Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CreateHotpatchableImage>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NoExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\controller\DB.hpp" />

+ 8 - 4
windows/ZeroTierOne/ZeroTierOneService.cpp

@@ -76,9 +76,7 @@ restart_node:
 			ZeroTier::Mutex::Lock _l(_lock);
 			delete _service;
 			_service = (ZeroTier::OneService *)0; // in case newInstance() fails
-			_service = ZeroTier::OneService::newInstance(
-				ZeroTier::OneService::platformDefaultHomePath().c_str(),
-				ZT_DEFAULT_PORT);
+			_service = ZeroTier::OneService::newInstance(_path.c_str(), ZT_DEFAULT_PORT);
 		}
 		switch(_service->run()) {
 			case ZeroTier::OneService::ONE_UNRECOVERABLE_ERROR: {
@@ -120,10 +118,16 @@ restart_node:
 	}
 }
 
-void ZeroTierOneService::OnStart(DWORD dwArgc, LPSTR *lpszArgv)
+void ZeroTierOneService::OnStart(DWORD dwArgc, PSTR *lpszArgv)
 {
 	ZT_SVCDBG("ZeroTierOneService::OnStart()\r\n");
 
+	if ((dwArgc > 1)&&(lpszArgv[1])&&(strlen(lpszArgv[1]) > 0)) {
+		this->_path = lpszArgv[1];
+	} else {
+		this->_path = ZeroTier::OneService::platformDefaultHomePath();
+	}
+
 	try {
 		_thread = ZeroTier::Thread::start(this);
 	} catch ( ... ) {

+ 3 - 2
windows/ZeroTierOne/ZeroTierOneService.h

@@ -57,11 +57,12 @@ public:
 		throw();
 
 protected:
-    virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
-    virtual void OnStop();
+	virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
+	virtual void OnStop();
 	virtual void OnShutdown();
 
 private:
+	std::string _path;
 	ZeroTier::OneService *volatile _service;
 	ZeroTier::Mutex _lock;
 	ZeroTier::Thread _thread;