Skip to content

Commit

Permalink
Merge branch 'jb51497' into 'master'
Browse files Browse the repository at this point in the history
Add support for ping and ping-exit for OpenVPN provisioning

See merge request mer-core/nemo-qml-plugin-systemsettings!156
  • Loading branch information
LaakkonenJussi committed Oct 22, 2020
2 parents 0ee3036 + b64c0ef commit 1a0b3df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions rpm/nemo-qml-plugin-systemsettings.spec
Expand Up @@ -35,6 +35,7 @@ BuildRequires: pkgconfig(sailfishaccesscontrol)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(sailfishusermanager)
BuildRequires: qt5-qttools-linguist
BuildRequires: pkgconfig(openssl)

%description
%{summary}.
Expand Down
20 changes: 19 additions & 1 deletion src/settingsvpnmodel.cpp
Expand Up @@ -799,8 +799,26 @@ QVariantMap SettingsVpnModel::processOpenVpnProvisioningFile(QFile &provisioning
if (!arguments.isEmpty()) {
rv.insert(QStringLiteral("OpenVPN.RemoteCertTls"), arguments.join(QChar(' ')));
}
} else if (directive == QStringLiteral("ping")) {
if (!arguments.isEmpty()) {
rv.insert(QStringLiteral("OpenVPN.Ping"), arguments.join(QChar(' ')));
}
} else if (directive == QStringLiteral("ping-exit")) {
if (!arguments.isEmpty()) {
rv.insert(QStringLiteral("OpenVPN.PingExit"), arguments.join(QChar(' ')));
}
} else if (directive == QStringLiteral("remap-usr1")) {
if (!arguments.isEmpty()) {
rv.insert(QStringLiteral("OpenVPN.RemapUsr1"), arguments.join(QChar(' ')));
}
} else if (directive == QStringLiteral("ping-restart")) {
// Ignore, must not be set with ConnMan
qInfo() << "Ignoring ping-restart with OpenVPN";
} else if (directive == QStringLiteral("connect-retry-max")) {
// Ignore, must not be set with ConnMan
qInfo() << "Ignoring connect-retry-max with OpenVPN";
} else {
// A directive that connman does not care about - pass through to the config file
// A directive that ConnMan does not care about - pass through to the config file
extraOptions.append(line);
}
}
Expand Down

0 comments on commit 1a0b3df

Please sign in to comment.