diff --git a/Source/NETworkManager.Models/Network/NetworkInterface.cs b/Source/NETworkManager.Models/Network/NetworkInterface.cs index 7cd8c34038..520b1135f1 100644 --- a/Source/NETworkManager.Models/Network/NetworkInterface.cs +++ b/Source/NETworkManager.Models/Network/NetworkInterface.cs @@ -25,18 +25,25 @@ public sealed class NetworkInterface { #region Variables - /* Ref #3286 - private static List NetworkInterfacesBlacklist = + /// + /// List of network interface name patterns to filter out virtual/filter adapters + /// introduced in .NET 9/10. These are typically not actual network interfaces but rather + /// drivers, filters, or extensions attached to real network interfaces. + /// See: https://github.com/dotnet/runtime/issues/122751 + /// + private static readonly List NetworkInterfaceFilteredPatterns = [ "Hyper-V Virtual Switch Extension Filter", + "Hyper-V Virtual Switch Extension Adapter", "WFP Native MAC Layer LightWeight Filter", "Npcap Packet Driver (NPCAP)", "QoS Packet Scheduler", "WFP 802.3 MAC Layer LightWeight Filter", - "Ethernet (Kerneldebugger)", - "Filter Driver" + "Ethernet (Kerneldebugger)", + "Filter Driver", + "WAN Miniport", + "Microsoft Wi-Fi Direct Virtual Adapter" ]; - */ #endregion @@ -74,12 +81,13 @@ public static List GetNetworkInterfaces() (int)networkInterface.NetworkInterfaceType != 53) continue; - // Check if part of the Name is in blacklist Ref #3286 - //if (NetworkInterfacesBlacklist.Any(networkInterface.Name.Contains)) - // continue; - - //Debug.WriteLine(networkInterface.Name); - //Debug.WriteLine($" Description: {networkInterface.Description}"); + // Filter out virtual/filter adapters introduced in .NET 9/10 + // Check if the adapter name or description contains any filtered pattern + // See: https://github.com/dotnet/runtime/issues/122751 + if (NetworkInterfaceFilteredPatterns.Any(pattern => + networkInterface.Name.Contains(pattern) || + networkInterface.Description.Contains(pattern))) + continue; var listIPv4Address = new List>(); var listIPv6AddressLinkLocal = new List(); diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 5995a082e8..c477c766ae 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -20,6 +20,8 @@ Release date: **xx.xx.2025** - Migrated from .NET 8.0 (LTS) to .NET 10.0 (LTS). Upgrade your [.NET Desktop Runtime to version 10.0 (LTS) - x64](https://dotnet.microsoft.com/en-us/download/dotnet/10.0/runtime) before you install this version. [#3229](https://github.com/BornToBeRoot/NETworkManager/pull/3229) +- Starting with .NET 9.0, the behavior of `NetworkInterface.GetAllNetworkInterfaces()` changed — the API now returns all network interfaces (including virtual adapters, WAN Miniport, extensions/drivers, etc.), which can cause additional or unexpected adapters to appear in the `Network Interface` view. This is an intentional change by Microsoft; see [dotnet/runtime#122751](https://github.com/dotnet/runtime/issues/122751) for details. To reduce noise, NETworkManager maintains a blacklist of known unwanted adapters. If you encounter adapters that should be excluded, please report them via the [issue tracker](https://github.com/BornToBeRoot/NETworkManager/issues/new/choose). [#3286](https://github.com/BornToBeRoot/NETworkManager/issues/3286) [#3309](https://github.com/BornToBeRoot/NETworkManager/pull/3309) + - `AWS Session Manager` feature has been removed. The [AWS Session Manager Plugin](https://github.com/aws/session-manager-plugin) is not actively maintained and contains several bugs (e.g. German / Spain keyboard layout issues). The current code base was also difficult to maintain and extend, and I currently have no test environment. The Sync feature (EC2 instances -> Profiles) has been removed as well, because it was limited to AWS Session Manager only. This will be re-introduced in a future release to support multiple providers (`AWS`, `Azure`, etc.) and more features like `Ping Monitor`, `PuTTY` or `Remote Desktop`.