summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-08-22 18:29:20 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-08-22 18:29:20 +0000
commit8e9666d57550398eabd619b34d90ec69d69eb218 (patch)
tree9b4e7f4693a085cafc910534844434aac8ba104e /options.c
parentb69d5cc8f54d159ee4df3e3bd36b185fa183da40 (diff)
downloadopenvpn-8e9666d57550398eabd619b34d90ec69d69eb218.tar.gz
openvpn-8e9666d57550398eabd619b34d90ec69d69eb218.tar.xz
openvpn-8e9666d57550398eabd619b34d90ec69d69eb218.zip
Added --remote-random-hostname option.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4843 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'options.c')
-rw-r--r--options.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/options.c b/options.c
index a83c6a2..eba311b 100644
--- a/options.c
+++ b/options.c
@@ -90,6 +90,7 @@ static const char usage_message[] =
"--local host : Local host name or ip address. Implies --bind.\n"
"--remote host [port] : Remote host name or ip address.\n"
"--remote-random : If multiple --remote options specified, choose one randomly.\n"
+ "--remote-random-hostname : Add a random string to remote DNS name.\n"
"--mode m : Major mode, m = 'p2p' (default, point-to-point) or 'server'.\n"
"--proto p : Use protocol p for communicating with peer.\n"
" p = udp (default), tcp-server, or tcp-client\n"
@@ -4420,15 +4421,27 @@ add_option (struct options *options,
}
options->routes->flags |= RG_ENABLE;
}
+ else if (streq (p[0], "remote-random-hostname"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->sockflags |= SF_HOST_RANDOMIZE;
+ }
else if (streq (p[0], "setenv") && p[1])
{
VERIFY_PERMISSION (OPT_P_GENERAL);
- if (streq (p[1], "FORWARD_COMPATIBLE") && p[2] && streq (p[2], "1"))
+ if (streq (p[1], "REMOTE_RANDOM_HOSTNAME"))
+ {
+ options->sockflags |= SF_HOST_RANDOMIZE;
+ }
+ else
{
- options->forward_compatible = true;
- msglevel_fc = msglevel_forward_compatible (options, msglevel);
+ if (streq (p[1], "FORWARD_COMPATIBLE") && p[2] && streq (p[2], "1"))
+ {
+ options->forward_compatible = true;
+ msglevel_fc = msglevel_forward_compatible (options, msglevel);
+ }
+ setenv_str (es, p[1], p[2] ? p[2] : "");
}
- setenv_str (es, p[1], p[2] ? p[2] : "");
}
else if (streq (p[0], "setenv-safe") && p[1])
{