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)
{
return KillSwitch::instance()->allowTrafficTo(ranges);
return KillSwitch::instance()->resetAllowedRange(ranges);
}
bool IpcServer::addKillSwitchExceptions(QStringList ranges)

View file

@ -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) {

View file

@ -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();