소스 검색

Two fixes

BaronGreenback 5 년 전
부모
커밋
bde1a38a88
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      Emby.Server.Implementations/Networking/NetworkManager.cs

+ 11 - 0
Emby.Server.Implementations/Networking/NetworkManager.cs

@@ -152,6 +152,11 @@ namespace Emby.Server.Implementations.Networking
                 return true;
             }
 
+            if (!IPAddress.TryParse(endpoint, out _))
+            {
+                return false;
+            }
+
             byte[] octet = IPAddress.Parse(endpoint).GetAddressBytes();
 
             if ((octet[0] == 10) ||
@@ -268,6 +273,12 @@ namespace Emby.Server.Implementations.Networking
             string excludeAddress = "[" + addressString + "]";
             var subnets = LocalSubnetsFn();
 
+            // Include any address if LAN subnets aren't specified
+            if (subnets.Length == 0)
+            {
+                return true;
+            }
+
             // Exclude any addresses if they appear in the LAN list in [ ]
             if (Array.IndexOf(subnets, excludeAddress) != -1)
             {