diff options
| -rw-r--r-- | Emby.Common.Implementations/Networking/NetworkManager.cs | 23 | ||||
| -rw-r--r-- | src/Emby.Server/Emby.Server.xproj | 5 | ||||
| -rw-r--r-- | src/Emby.Server/project.json | 24 |
3 files changed, 47 insertions, 5 deletions
diff --git a/Emby.Common.Implementations/Networking/NetworkManager.cs b/Emby.Common.Implementations/Networking/NetworkManager.cs index b9100f9db..a4e6d47d4 100644 --- a/Emby.Common.Implementations/Networking/NetworkManager.cs +++ b/Emby.Common.Implementations/Networking/NetworkManager.cs @@ -198,6 +198,12 @@ namespace Emby.Common.Implementations.Networking return Dns.GetHostAddressesAsync(hostName); } + private readonly List<NetworkInterfaceType> _validNetworkInterfaceTypes = new List<NetworkInterfaceType> + { + NetworkInterfaceType.Ethernet, + NetworkInterfaceType.Wireless80211 + }; + private List<IPAddress> GetIPsDefault() { NetworkInterface[] interfaces; @@ -223,9 +229,22 @@ namespace Emby.Common.Implementations.Networking { Logger.Debug("Querying interface: {0}. Type: {1}. Status: {2}", network.Name, network.NetworkInterfaceType, network.OperationalStatus); - var properties = network.GetIPProperties(); + var ipProperties = network.GetIPProperties(); + + // Try to exclude virtual adapters + // http://stackoverflow.com/questions/8089685/c-sharp-finding-my-machines-local-ip-address-and-not-the-vms + var addr = ipProperties.GatewayAddresses.FirstOrDefault(); + if (addr == null|| string.Equals(addr.Address.ToString(), "0.0.0.0", StringComparison.OrdinalIgnoreCase)) + { + return new List<IPAddress>(); + } + + //if (!_validNetworkInterfaceTypes.Contains(network.NetworkInterfaceType)) + //{ + // return new List<IPAddress>(); + //} - return properties.UnicastAddresses + return ipProperties.UnicastAddresses .Where(i => i.IsDnsEligible) .Select(i => i.Address) .Where(i => i.AddressFamily == AddressFamily.InterNetwork) diff --git a/src/Emby.Server/Emby.Server.xproj b/src/Emby.Server/Emby.Server.xproj index 6a23809ce..2462c5179 100644 --- a/src/Emby.Server/Emby.Server.xproj +++ b/src/Emby.Server/Emby.Server.xproj @@ -37,5 +37,10 @@ <ProjectReference Include="..\..\ServiceStack\ServiceStack.csproj" /> <ProjectReference Include="..\..\SocketHttpListener.Portable\SocketHttpListener.Portable.csproj" /> </ItemGroup> + <ItemGroup> + <Compile Include="..\..\SharedVersion.cs"> + <Link>Properties\SharedVersion.cs</Link> + </Compile> + </ItemGroup> <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> </Project>
\ No newline at end of file diff --git a/src/Emby.Server/project.json b/src/Emby.Server/project.json index 5b64beae6..852c7d519 100644 --- a/src/Emby.Server/project.json +++ b/src/Emby.Server/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "3.1.0-*", "buildOptions": { "emitEntryPoint": true }, @@ -33,8 +33,26 @@ "win10-arm64": {}, "osx.10.10-x64": {}, "osx.10.11-x64": {}, - "osx.10.12-x64": {}, - "ubuntu.14.04-x64": {} + "osx.10.12-x64": , + "rhel.7.0-x64": {}, + "rhel.7.1-x64": {}, + "rhel.7.2-x64": {}, + "ubuntu.14.04-x64": {}, + "ubuntu.14.10-x64": {}, + "ubuntu.15.04-x64": {}, + "ubuntu.15.10-x64": {}, + "ubuntu.16.04-x64": {}, + "ubuntu.16.10-x64": {}, + "centos.7-x64": {}, + "debian.8-x64": {}, + "fedora.23-x64": {}, + "fedora.24-x64": {}, + "opensuse.13.2-x64": {}, + "opensuse.42.1-x64": {}, + "ol.7-x64": {}, + "ol.7.0-x64": {}, + "ol.7.1-x64": {}, + "ol.7.2-x64": {} }, "frameworks": { |
