Review fixes

This commit is contained in:
aiamnezia 2025-04-24 16:35:37 +04:00
parent 5bf5cd43bd
commit 6be32445ba
3 changed files with 4 additions and 9 deletions

View file

@ -181,7 +181,7 @@ void IpcServer::setLogsEnabled(bool enabled)
bool IpcServer::allowTrafficTo(QStringList ranges) bool IpcServer::allowTrafficTo(QStringList ranges)
{ {
return KillSwitch::instance()->allowTrafficTo(ranges); return KillSwitch::instance()->resetAllowedRange(ranges);
} }
bool IpcServer::addKillSwitchExceptions(QStringList ranges) bool IpcServer::addKillSwitchExceptions(QStringList ranges)

View file

@ -155,7 +155,7 @@ bool KillSwitch::disableAllTraffic() {
return true; return true;
} }
bool KillSwitch::allowTrafficTo(const QStringList &ranges) { bool KillSwitch::resetAllowedRange(const QStringList &ranges) {
m_allowedRanges = ranges; m_allowedRanges = ranges;
@ -186,12 +186,7 @@ bool KillSwitch::addAllowedRange(const QStringList &ranges) {
} }
} }
#ifdef Q_OS_WIN return resetAllowedRange(m_allowedRanges);
WindowsFirewall::create(this)->allowTrafficRange(ranges);
return true;
#else
return allowTrafficTo(m_allowedRanges);
#endif
} }
bool KillSwitch::enablePeerTraffic(const QJsonObject &configStr) { bool KillSwitch::enablePeerTraffic(const QJsonObject &configStr) {

View file

@ -17,7 +17,7 @@ public:
bool disableAllTraffic(); bool disableAllTraffic();
bool enablePeerTraffic(const QJsonObject &configStr); bool enablePeerTraffic(const QJsonObject &configStr);
bool enableKillSwitch(const QJsonObject &configStr, int vpnAdapterIndex); bool enableKillSwitch(const QJsonObject &configStr, int vpnAdapterIndex);
bool allowTrafficTo(const QStringList &ranges); bool resetAllowedRange(const QStringList &ranges);
bool addAllowedRange(const QStringList &ranges); bool addAllowedRange(const QStringList &ranges);
bool isStrictKillSwitchEnabled(); bool isStrictKillSwitchEnabled();