aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-09 08:36:26 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-11-09 08:36:26 +0000
commitb540a9e07571aaaeea5cc2b81e695829d228c2f1 (patch)
treee7e2e86384943f6e5541865970aedf88b7590488 /options.c
parentRemoved annoying 'i' variable from add_option. (diff)
downloadopenvpn-b540a9e07571aaaeea5cc2b81e695829d228c2f1.tar.xz
Merged (with some changes) Alon's
connect-retry-max option from /contrib/alon/BETA21@783. Added uninit_management_callback call to init_instance_handle_signals so that signals thrown during initialization can bring us back to a management hold. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@786 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'options.c')
-rw-r--r--options.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/options.c b/options.c
index 2e89b67..466ba13 100644
--- a/options.c
+++ b/options.c
@@ -95,6 +95,7 @@ static const char usage_message[] =
" p = udp (default), tcp-server, or tcp-client\n"
"--connect-retry n : For --proto tcp-client, number of seconds to wait\n"
" between connection retries (default=%d).\n"
+ "--connect-retry-max n : Maximum connection attempt retries, default infinite.\n"
#ifdef ENABLE_HTTP_PROXY
"--http-proxy s p [up] [auth] : Connect to remote host through an HTTP proxy at\n"
" address s and port p. If proxy authentication is required,\n"
@@ -586,6 +587,7 @@ init_options (struct options *o)
o->topology = TOP_NET30;
o->proto = PROTO_UDPv4;
o->connect_retry_seconds = 5;
+ o->connect_retry_max = 0;
o->local_port = o->remote_port = OPENVPN_PORT;
o->verbosity = 1;
o->status_file_update_freq = 60;
@@ -1086,6 +1088,7 @@ show_settings (const struct options *o)
SHOW_INT (resolve_retry_seconds);
SHOW_INT (connect_retry_seconds);
+ SHOW_INT (connect_retry_max);
SHOW_STR (username);
SHOW_STR (groupname);
@@ -3218,6 +3221,11 @@ add_option (struct options *options,
options->connect_retry_seconds = positive_atoi (p[1]);
options->connect_retry_defined = true;
}
+ else if (streq (p[0], "connect-retry-max") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->connect_retry_max = positive_atoi (p[1]);
+ }
else if (streq (p[0], "ipchange") && p[1])
{
VERIFY_PERMISSION (OPT_P_SCRIPT);