diff --git a/ipc/ipcserver.cpp b/ipc/ipcserver.cpp index 445ee954..f8a25eb6 100644 --- a/ipc/ipcserver.cpp +++ b/ipc/ipcserver.cpp @@ -181,7 +181,7 @@ void IpcServer::setLogsEnabled(bool enabled) bool IpcServer::allowTrafficTo(QStringList ranges) { - return KillSwitch::instance()->allowTrafficTo(ranges); + return KillSwitch::instance()->resetAllowedRange(ranges); } bool IpcServer::addKillSwitchExceptions(QStringList ranges) diff --git a/service/server/killswitch.cpp b/service/server/killswitch.cpp index 70bfeb4d..c44bd6a2 100644 --- a/service/server/killswitch.cpp +++ b/service/server/killswitch.cpp @@ -155,7 +155,7 @@ bool KillSwitch::disableAllTraffic() { return true; } -bool KillSwitch::allowTrafficTo(const QStringList &ranges) { +bool KillSwitch::resetAllowedRange(const QStringList &ranges) { m_allowedRanges = ranges; @@ -186,12 +186,7 @@ bool KillSwitch::addAllowedRange(const QStringList &ranges) { } } -#ifdef Q_OS_WIN - WindowsFirewall::create(this)->allowTrafficRange(ranges); - return true; -#else - return allowTrafficTo(m_allowedRanges); -#endif + return resetAllowedRange(m_allowedRanges); } bool KillSwitch::enablePeerTraffic(const QJsonObject &configStr) { diff --git a/service/server/killswitch.h b/service/server/killswitch.h index 12343df3..519e2ed2 100644 --- a/service/server/killswitch.h +++ b/service/server/killswitch.h @@ -17,7 +17,7 @@ public: bool disableAllTraffic(); bool enablePeerTraffic(const QJsonObject &configStr); bool enableKillSwitch(const QJsonObject &configStr, int vpnAdapterIndex); - bool allowTrafficTo(const QStringList &ranges); + bool resetAllowedRange(const QStringList &ranges); bool addAllowedRange(const QStringList &ranges); bool isStrictKillSwitchEnabled();