Code cleanup [noci]
This commit is contained in:
parent
e0863a58aa
commit
3a87354f8d
2 changed files with 1 additions and 10 deletions
|
@ -13,14 +13,10 @@
|
||||||
#include <QJsonValue>
|
#include <QJsonValue>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
//#include "errorhandler.h"
|
|
||||||
#include "ipaddress.h"
|
#include "ipaddress.h"
|
||||||
#include "leakdetector.h"
|
#include "leakdetector.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
//#include "models/device.h"
|
|
||||||
//#include "models/keys.h"
|
|
||||||
#include "models/server.h"
|
#include "models/server.h"
|
||||||
//#include "settingsholder.h"
|
|
||||||
|
|
||||||
// How many times do we try to reconnect.
|
// How many times do we try to reconnect.
|
||||||
constexpr int MAX_CONNECTION_RETRY = 10;
|
constexpr int MAX_CONNECTION_RETRY = 10;
|
||||||
|
@ -145,11 +141,9 @@ void LocalSocketController::activate(const QJsonObject &rawConfig) {
|
||||||
QJsonArray defaultAllowedIP = QJsonArray::fromStringList(QString("0.0.0.0/0, ::/0").split(","));
|
QJsonArray defaultAllowedIP = QJsonArray::fromStringList(QString("0.0.0.0/0, ::/0").split(","));
|
||||||
|
|
||||||
if (plainAllowedIP != defaultAllowedIP && !plainAllowedIP.isEmpty()) {
|
if (plainAllowedIP != defaultAllowedIP && !plainAllowedIP.isEmpty()) {
|
||||||
// Use AllowedIP list from WG config bacouse of higer priority
|
// Use AllowedIP list from WG config because of higher priority
|
||||||
|
|
||||||
for (auto v : plainAllowedIP) {
|
for (auto v : plainAllowedIP) {
|
||||||
QString ipRange = v.toString();
|
QString ipRange = v.toString();
|
||||||
qDebug() << "ipRange " << ipRange;
|
|
||||||
if (ipRange.split('/').size() > 1){
|
if (ipRange.split('/').size() > 1){
|
||||||
QJsonObject range;
|
QJsonObject range;
|
||||||
range.insert("address", ipRange.split('/')[0]);
|
range.insert("address", ipRange.split('/')[0]);
|
||||||
|
@ -184,7 +178,6 @@ void LocalSocketController::activate(const QJsonObject &rawConfig) {
|
||||||
if (splitTunnelType == 1) {
|
if (splitTunnelType == 1) {
|
||||||
for (auto v : splitTunnelSites) {
|
for (auto v : splitTunnelSites) {
|
||||||
QString ipRange = v.toString();
|
QString ipRange = v.toString();
|
||||||
qDebug() << "ipRange " << ipRange;
|
|
||||||
if (ipRange.split('/').size() > 1){
|
if (ipRange.split('/').size() > 1){
|
||||||
QJsonObject range;
|
QJsonObject range;
|
||||||
range.insert("address", ipRange.split('/')[0]);
|
range.insert("address", ipRange.split('/')[0]);
|
||||||
|
|
|
@ -307,14 +307,12 @@ bool IpcServer::enablePeerTraffic(const QJsonObject &configStr)
|
||||||
if (splitTunnelType == 1) {
|
if (splitTunnelType == 1) {
|
||||||
for (auto v : splitTunnelSites) {
|
for (auto v : splitTunnelSites) {
|
||||||
QString ipRange = v.toString();
|
QString ipRange = v.toString();
|
||||||
qDebug() << "ipRange " << ipRange;
|
|
||||||
if (ipRange.split('/').size() > 1){
|
if (ipRange.split('/').size() > 1){
|
||||||
config.m_allowedIPAddressRanges.append(
|
config.m_allowedIPAddressRanges.append(
|
||||||
IPAddress(QHostAddress(ipRange.split('/')[0]), atoi(ipRange.split('/')[1].toLocal8Bit())));
|
IPAddress(QHostAddress(ipRange.split('/')[0]), atoi(ipRange.split('/')[1].toLocal8Bit())));
|
||||||
} else {
|
} else {
|
||||||
config.m_allowedIPAddressRanges.append(
|
config.m_allowedIPAddressRanges.append(
|
||||||
IPAddress(QHostAddress(ipRange), 32));
|
IPAddress(QHostAddress(ipRange), 32));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue