@@ -552,14 +552,10 @@
/*
* Sanity checks.
*/
- if (o->keepalive_ping <= 0 || o->keepalive_timeout <= 0)
- {
- msg(M_USAGE, "--keepalive parameters must be > 0");
- }
if (o->keepalive_ping * 2 > o->keepalive_timeout)
{
msg(M_USAGE,
- "the second parameter to --keepalive (restart timeout=%d) must be at least twice the value of the first parameter (ping interval=%d). A ratio of 1:5 or 1:6 would be even better. Recommended setting is --keepalive 10 60.",
+ "The second parameter to --keepalive (restart timeout=%d) must be at least twice the value of the first parameter (ping interval=%d). A ratio of 1:5 or 1:6 would be even better. Recommended setting is --keepalive 10 60.",
o->keepalive_timeout, o->keepalive_ping);
}
if (o->ping_send_timeout || o->ping_rec_timeout)
@@ -6755,8 +6755,8 @@
else if (streq(p[0], "keepalive") && p[1] && p[2] && !p[3])
{
VERIFY_PERMISSION(OPT_P_GENERAL);
- options->keepalive_ping = atoi_warn(p[1], msglevel);
- options->keepalive_timeout = atoi_warn(p[2], msglevel);
+ atoi_constrained(p[1], &options->keepalive_ping, "keepalive ping", 1, INT_MAX, msglevel);
+ atoi_constrained(p[2], &options->keepalive_timeout, "keepalive timeout", 1, INT_MAX, msglevel);
}
else if (streq(p[0], "ping") && p[1] && !p[2])
{