Update DlnaEntryPoint.cs

pull/4125/head
BaronGreenback 4 years ago committed by GitHub
parent fb1d452b59
commit 28634d3b36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -259,15 +259,16 @@ namespace Emby.Dlna.Main
private void RegisterServerEndpoints() private void RegisterServerEndpoints()
{ {
var bindAddresses = _networkManager.GetInternalBindAddresses()
.Where(i => i.AddressFamily == AddressFamily.InterNetwork || (i.AddressFamily == AddressFamily.InterNetworkV6 && i.Address.ScopeId != 0));
var udn = CreateUuid(_appHost.SystemId); var udn = CreateUuid(_appHost.SystemId);
if (!bindAddresses.Any()) var ba = new NetCollection(
_networkManager.GetInternalBindAddresses()
.Where(i => i.AddressFamily == AddressFamily.InterNetwork || (i.AddressFamily == AddressFamily.InterNetworkV6 && i.Address.ScopeId != 0)));
if (ba.Count == 0)
{ {
// No interfaces returned, so use loopback. // No interfaces returned, so use loopback.
bindAddresses = _networkManager.GetLoopbacks(); ba = _networkManager.GetLoopbacks();
} }
foreach (var addr in bindAddresses) foreach (var addr in bindAddresses)

Loading…
Cancel
Save