Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[settings-vpn] Add ping, ping-exit and remap-usr1 to OpenVPN provisio…
…ning. JB#51497

Support ping, ping-exit and remap-usr1 values loaded from OpenVPN
config. remap-usr1 should have either SIGHUP or SIGTERM but verification
is not done here.

Prevent use of ping-restart and connect-retry-max as they should not be
allowed with ConnMan, since both will mess up with the VPN connectivity
when restarts happen.

Add remap-usr1 as supported OpenVPN option
  • Loading branch information
LaakkonenJussi committed Oct 21, 2020
1 parent 0ee3036 commit 11158b8
Showing 1 changed file with 19 additions and 1 deletion.
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 11158b8

Please sign in to comment.