Migrate NetworkManager and Tests to native .NET IP objects

This commit is contained in:
Shadowghost
2022-07-19 21:28:04 +02:00
parent c2902dd108
commit 066db8ac7f
18 changed files with 1116 additions and 2663 deletions

View File

@@ -7,6 +7,7 @@ using System.Net;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using Microsoft.AspNetCore.HttpOverrides;
namespace Rssdp.Infrastructure
{
@@ -297,9 +298,9 @@ namespace Rssdp.Infrastructure
foreach (var device in deviceList)
{
var root = device.ToRootDevice();
var source = new IPNetAddress(root.Address, root.PrefixLength);
var destination = new IPNetAddress(remoteEndPoint.Address, root.PrefixLength);
if (!_sendOnlyMatchedHost || source.NetworkAddress.Equals(destination.NetworkAddress))
var source = new IPData(root.Address, new IPNetwork(root.Address, root.PrefixLength), root.FriendlyName);
var destination = new IPData(remoteEndPoint.Address, new IPNetwork(root.Address, root.PrefixLength));
if (!_sendOnlyMatchedHost || source.Address.Equals(destination.Address))
{
SendDeviceSearchResponses(device, remoteEndPoint, receivedOnlocalIpAddress, cancellationToken);
}