瀏覽代碼

Updated to latest version of code.

Greenback 4 年之前
父節點
當前提交
ec57eeff2b

+ 1 - 1
Emby.Dlna/Main/DlnaEntryPoint.cs

@@ -297,7 +297,7 @@ namespace Emby.Dlna.Main
                     CacheLifetime = TimeSpan.FromSeconds(1800), // How long SSDP clients can cache this info.
                     Location = uri, // Must point to the URL that serves your devices UPnP description document.
                     Address = address.Address,
-                    SubnetMask = address.Mask,
+                    PrefixLength = address.PrefixLength,
                     FriendlyName = "Jellyfin",
                     Manufacturer = "Jellyfin",
                     ModelName = "Jellyfin Server",

+ 1 - 1
Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs

@@ -52,7 +52,7 @@ namespace Jellyfin.Server.Middleware
                 if (remoteAddressFilter.Count > 0 && !networkManager.IsInLocalNetwork(remoteIp))
                 {
                     // remoteAddressFilter is a whitelist or blacklist.
-                    bool isListed = remoteAddressFilter.Contains(remoteIp);
+                    bool isListed = remoteAddressFilter.ContainsAddress(remoteIp);
                     if (!serverConfigurationManager.GetNetworkConfiguration().IsRemoteIPFilterBlacklist)
                     {
                         // Black list, so flip over.

+ 2 - 2
RSSDP/SsdpDevicePublisher.cs

@@ -302,8 +302,8 @@ namespace Rssdp.Infrastructure
                     foreach (var device in deviceList)
                     {
                         var root = device.ToRootDevice();
-                        var source = new IPNetAddress(root.Address, root.SubnetMask);
-                        var destination = new IPNetAddress(remoteEndPoint.Address, root.SubnetMask);
+                        var source = new IPNetAddress(root.Address, root.PrefixLength);
+                        var destination = new IPNetAddress(remoteEndPoint.Address, root.PrefixLength);
                         if (!_sendOnlyMatchedHost || source.NetworkAddress.Equals(destination.NetworkAddress))
                         {
                             SendDeviceSearchResponses(device, remoteEndPoint, receivedOnlocalIpAddress, cancellationToken);

+ 2 - 2
RSSDP/SsdpRootDevice.cs

@@ -45,9 +45,9 @@ namespace Rssdp
         public IPAddress Address { get; set; }
 
         /// <summary>
-        /// Gets or sets the SubnetMask used to check if the received message from same interface with this device/tree. Required.
+        /// Gets or sets the prefix length used to check if the received message from same interface with this device/tree. Required.
         /// </summary>
-        public IPAddress SubnetMask { get; set; }
+        public byte PrefixLength { get; set; }
 
         /// <summary>
         /// The base URL to use for all relative url's provided in other propertise (and those of child devices). Optional.