mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Fixed: Opening firewall ports when system has more than one network adapter
This commit is contained in:
parent
dcd1b55d1f
commit
c122a94bc0
1 changed files with 3 additions and 2 deletions
|
@ -80,9 +80,10 @@ namespace NzbDrone.Host.AccessControl
|
||||||
|
|
||||||
var netFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", false);
|
var netFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", false);
|
||||||
var mgr = (INetFwMgr)Activator.CreateInstance(netFwMgrType);
|
var mgr = (INetFwMgr)Activator.CreateInstance(netFwMgrType);
|
||||||
var ports = mgr.LocalPolicy.CurrentProfile.GloballyOpenPorts;
|
|
||||||
|
|
||||||
ports.Add(port);
|
//Adds ports for both the current profile and the 'standard' (private) profile
|
||||||
|
mgr.LocalPolicy.GetProfileByType(NET_FW_PROFILE_TYPE_.NET_FW_PROFILE_CURRENT).GloballyOpenPorts.Add(port);
|
||||||
|
mgr.LocalPolicy.GetProfileByType(NET_FW_PROFILE_TYPE_.NET_FW_PROFILE_STANDARD).GloballyOpenPorts.Add(port);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue