diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2009-08-22 18:29:20 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2009-08-22 18:29:20 +0000 |
commit | 8e9666d57550398eabd619b34d90ec69d69eb218 (patch) | |
tree | 9b4e7f4693a085cafc910534844434aac8ba104e /options.c | |
parent | Fixed ifconfig command for "topology subnet" on FreeBSD (Stefan Bethke). (diff) | |
download | openvpn-8e9666d57550398eabd619b34d90ec69d69eb218.tar.xz |
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.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -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]) { |