From 4a81c9d3253360a6a3e086131765c41a6fae039f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger?= Date: Mon, 14 Dec 2015 16:04:01 +0100 Subject: [PATCH] Fixed bug in MAC address generator which caused a crash --- Installer/ScpToolkit Setup.aip | 4 +-- ScpCleanWipe/Properties/CommonInfo.cs | 4 +-- ScpControl/Properties/CommonInfo.cs | 4 +-- ScpControl/ScpControl.csproj | 2 +- ScpControl/Utilities/MacAddressGenerator.cs | 29 +++---------------- .../Properties/CommonInfo.cs | 4 +-- ScpDriverInstaller/Properties/CommonInfo.cs | 4 +-- ScpGamepadAnalyzer/Properties/CommonInfo.cs | 4 +-- ScpMonitor/Properties/CommonInfo.cs | 4 +-- ScpPair/Properties/CommonInfo.cs | 4 +-- ScpProfiler/Properties/CommonInfo.cs | 4 +-- ScpServer/Properties/CommonInfo.cs | 4 +-- ScpService/Properties/CommonInfo.cs | 4 +-- ScpSettings/Properties/CommonInfo.cs | 4 +-- ScpXInputBridge/Properties/CommonInfo.cs | 4 +-- 15 files changed, 31 insertions(+), 52 deletions(-) diff --git a/Installer/ScpToolkit Setup.aip b/Installer/ScpToolkit Setup.aip index b2052916..4c62766b 100644 --- a/Installer/ScpToolkit Setup.aip +++ b/Installer/ScpToolkit Setup.aip @@ -14,10 +14,10 @@ - + - + diff --git a/ScpCleanWipe/Properties/CommonInfo.cs b/ScpCleanWipe/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpCleanWipe/Properties/CommonInfo.cs +++ b/ScpCleanWipe/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpControl/Properties/CommonInfo.cs b/ScpControl/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpControl/Properties/CommonInfo.cs +++ b/ScpControl/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpControl/ScpControl.csproj b/ScpControl/ScpControl.csproj index 3fa5079e..7fab37b6 100644 --- a/ScpControl/ScpControl.csproj +++ b/ScpControl/ScpControl.csproj @@ -23,7 +23,7 @@ AssemblyVersionAttribute - 1.6.202.15347 + 1.6.204.15348 true diff --git a/ScpControl/Utilities/MacAddressGenerator.cs b/ScpControl/Utilities/MacAddressGenerator.cs index 35987401..a95c95f8 100644 --- a/ScpControl/Utilities/MacAddressGenerator.cs +++ b/ScpControl/Utilities/MacAddressGenerator.cs @@ -22,34 +22,13 @@ public static string NewMacAddress var b = Convert.ToByte(number); if (i == 0) { - b = SetBit(b, 6); //--> set locally administered - b = UnsetBit(b, 7); // --> set unicast + b = (byte) ((b & 0xFE) | 0x02); //-->set locally administered and unicast } - sBuilder.Append(string.Format("{0}:", number.ToString("X2"))); + sBuilder.Append(string.Format("{0}", number.ToString("X2"))); } - return sBuilder.ToString().ToUpper().TrimEnd(':'); + return sBuilder.ToString(); } } - - private static byte SetBit(byte b, int bitNumber) - { - if (bitNumber < 8 && bitNumber > -1) - { - return (byte) (b | (byte) (0x01 << bitNumber)); - } - - throw new ArgumentOutOfRangeException(bitNumber.ToString()); - } - - private static byte UnsetBit(byte b, int bitNumber) - { - if (bitNumber < 8 && bitNumber > -1) - { - return (byte) (b | (byte) (0x00 << bitNumber)); - } - - throw new ArgumentOutOfRangeException(bitNumber.ToString()); - } } -} \ No newline at end of file +} diff --git a/ScpDebugInfoCollector/Properties/CommonInfo.cs b/ScpDebugInfoCollector/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpDebugInfoCollector/Properties/CommonInfo.cs +++ b/ScpDebugInfoCollector/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpDriverInstaller/Properties/CommonInfo.cs b/ScpDriverInstaller/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpDriverInstaller/Properties/CommonInfo.cs +++ b/ScpDriverInstaller/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpGamepadAnalyzer/Properties/CommonInfo.cs b/ScpGamepadAnalyzer/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpGamepadAnalyzer/Properties/CommonInfo.cs +++ b/ScpGamepadAnalyzer/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpMonitor/Properties/CommonInfo.cs b/ScpMonitor/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpMonitor/Properties/CommonInfo.cs +++ b/ScpMonitor/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpPair/Properties/CommonInfo.cs b/ScpPair/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpPair/Properties/CommonInfo.cs +++ b/ScpPair/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpProfiler/Properties/CommonInfo.cs b/ScpProfiler/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpProfiler/Properties/CommonInfo.cs +++ b/ScpProfiler/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpServer/Properties/CommonInfo.cs b/ScpServer/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpServer/Properties/CommonInfo.cs +++ b/ScpServer/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpService/Properties/CommonInfo.cs b/ScpService/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpService/Properties/CommonInfo.cs +++ b/ScpService/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpSettings/Properties/CommonInfo.cs b/ScpSettings/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpSettings/Properties/CommonInfo.cs +++ b/ScpSettings/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file diff --git a/ScpXInputBridge/Properties/CommonInfo.cs b/ScpXInputBridge/Properties/CommonInfo.cs index bb0ec45a..5b1ba8bc 100644 --- a/ScpXInputBridge/Properties/CommonInfo.cs +++ b/ScpXInputBridge/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.202.15347")] -[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.204.15348")] +[assembly: AssemblyFileVersion("1.6.204.15348")] \ No newline at end of file