VPN: OpenVPN: Instances - improve keepalive validation, mentioned in https://github.com/opnsense/core/pull/10174

This commit is contained in:
Ad Schellevis
2026-10-06 09:54:49 +02:00
parent 89a74ce83f
commit 43dc040cfb
2 changed files with 6 additions and 1 deletions
@@ -189,6 +189,11 @@ class OpenVPN extends BaseModel
gettext('Timeout must be at least twice the interval value.'),
$key . ".keepalive_timeout"
));
} elseif ($instance->keepalive_interval->isEmpty() xor $instance->keepalive_timeout->isEmpty()) {
$messages->appendMessage(new Message(
gettext('To configure keepalive, both interval and timout need to be specified.'),
$key . ".keepalive_timeout"
));
}
if ($instance->dev_type == 'ovpn' && strpos($instance->proto, 'udp') === false) {
@@ -359,7 +359,7 @@
<MinimumValue>0</MinimumValue>
</keepalive_interval>
<keepalive_timeout type="IntegerField">
<MinimumValue>0</MinimumValue>
<MinimumValue>1</MinimumValue>
</keepalive_timeout>
<reneg-sec type="IntegerField">
<MinimumValue>0</MinimumValue>