From 837348ee45977158bdf9f423f09cb6539608d586 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 11 Aug 2008 15:34:38 -0700 Subject: fix for bug 3560: add lower limits for intervals --- scripts/VyattaClusterConfig.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/VyattaClusterConfig.pm b/scripts/VyattaClusterConfig.pm index 01979dc..3b564eb 100644 --- a/scripts/VyattaClusterConfig.pm +++ b/scripts/VyattaClusterConfig.pm @@ -6,6 +6,8 @@ use VyattaConfig; my $DEFAULT_INITDEAD = 30000; my $DEFAULT_DEADPING = 30000; +my $MIN_DEAD = 300; +my $MIN_KEEP = 100; my $DEFAULT_LOG_FACILITY = 'daemon'; my $SERVICE_DIR = "/etc/init.d"; my $RESOURCE_SCRIPT_DIR = "/etc/ha.d/resource.d"; @@ -223,6 +225,12 @@ sub ha_cf { if ($#secondaries < 0); return (undef, "using multiple secondary nodes is not supported yet") if ($#secondaries > 0); + return (undef, + "dead interval must be at least $MIN_DEAD milliseconds") + if ($ditvl < $MIN_DEAD); + return (undef, + "keepalive interval must be at least $MIN_KEEP milliseconds") + if ($kitvl < $MIN_KEEP); return (undef, "dead interval must be more than twice the keepalive interval") if ($ditvl <= (2 * $kitvl)); -- cgit v1.2.3