mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
fix: Skip over invalid adapter ids when getting network information
This commit is contained in:
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
### Changed
|
### Changed
|
||||||
- Network/MAC/DNS address utils are now enumerating all adapter types
|
- Network/MAC/DNS address utils are now enumerating all adapter types
|
||||||
- Ignoring Crestron ethernet parameters that say "Invalid Value"
|
- Ignoring Crestron ethernet parameters that say "Invalid Value"
|
||||||
|
- Skipping network interfaces with an invalid adapter id
|
||||||
|
|
||||||
## [10.2.0] - 2019-12-04
|
## [10.2.0] - 2019-12-04
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ namespace ICD.Common.Utils
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||||
|
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||||
|
continue;
|
||||||
|
|
||||||
address = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
address = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
@@ -77,6 +80,9 @@ namespace ICD.Common.Utils
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||||
|
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||||
|
continue;
|
||||||
|
|
||||||
macAddress = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
macAddress = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
@@ -105,6 +111,9 @@ namespace ICD.Common.Utils
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||||
|
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||||
|
return null;
|
||||||
|
|
||||||
string status = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
string status = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(status) && !status.Equals(INVALID_VALUE))
|
if (!string.IsNullOrEmpty(status) && !status.Equals(INVALID_VALUE))
|
||||||
@@ -137,6 +146,9 @@ namespace ICD.Common.Utils
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||||
|
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||||
|
continue;
|
||||||
|
|
||||||
hostname = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
hostname = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
|
|||||||
Reference in New Issue
Block a user