Fix some ssdp errors

This commit is contained in:
Shadowghost 2022-07-21 00:32:51 +02:00
parent 358642c2d9
commit 05458a4a42
2 changed files with 5 additions and 5 deletions

View File

@ -348,8 +348,6 @@ namespace Rssdp.Infrastructure
{
var sockets = new List<ISocket>();
sockets.Add(_SocketFactory.CreateSsdpUdpSocket(IPAddress.Any, _LocalPort));
if (_enableMultiSocketBinding)
{
foreach (var address in _networkManager.GetInternalBindAddresses())
@ -370,6 +368,10 @@ namespace Rssdp.Infrastructure
}
}
}
else
{
sockets.Add(_SocketFactory.CreateSsdpUdpSocket(IPAddress.Any, _LocalPort));
}
foreach (var socket in sockets)
{

View File

@ -298,9 +298,7 @@ namespace Rssdp.Infrastructure
foreach (var device in deviceList)
{
var root = device.ToRootDevice();
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))
if (!_sendOnlyMatchedHost || root.Address.Equals(remoteEndPoint.Address))
{
SendDeviceSearchResponses(device, remoteEndPoint, receivedOnlocalIpAddress, cancellationToken);
}