diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f8b2ab..61652bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Network/MAC/DNS address utils are now enumerating all adapter types - Ignoring Crestron ethernet parameters that say "Invalid Value" + - Skipping network interfaces with an invalid adapter id ## [10.2.0] - 2019-12-04 ### Added diff --git a/ICD.Common.Utils/IcdEnvironment.SimplSharp.cs b/ICD.Common.Utils/IcdEnvironment.SimplSharp.cs index 3d156f8..e43e2fa 100644 --- a/ICD.Common.Utils/IcdEnvironment.SimplSharp.cs +++ b/ICD.Common.Utils/IcdEnvironment.SimplSharp.cs @@ -46,6 +46,9 @@ namespace ICD.Common.Utils try { short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type); + if (id >= InitialParametersClass.NumberOfEthernetInterfaces) + continue; + address = CrestronEthernetHelper.GetEthernetParameter(param, id); } catch (ArgumentException) @@ -77,6 +80,9 @@ namespace ICD.Common.Utils try { short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type); + if (id >= InitialParametersClass.NumberOfEthernetInterfaces) + continue; + macAddress = CrestronEthernetHelper.GetEthernetParameter(param, id); } catch (ArgumentException) @@ -105,6 +111,9 @@ namespace ICD.Common.Utils try { short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type); + if (id >= InitialParametersClass.NumberOfEthernetInterfaces) + return null; + string status = CrestronEthernetHelper.GetEthernetParameter(param, id); if (!string.IsNullOrEmpty(status) && !status.Equals(INVALID_VALUE)) @@ -137,6 +146,9 @@ namespace ICD.Common.Utils try { short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type); + if (id >= InitialParametersClass.NumberOfEthernetInterfaces) + continue; + hostname = CrestronEthernetHelper.GetEthernetParameter(param, id); } catch (ArgumentException)