From: James Yonan <ja...@openvpn.net>

OpenVPN SVN r8126 (2.1.20)

Signed-off-by: Gert Doering <g...@greenie.muc.de>
---
 src/openvpn/options.c | 7 ++++++-
 src/openvpn/options.h | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index ec39212..88ed88a 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -4410,6 +4410,11 @@ add_option (struct options *options,
       options->force_connection_list = true;
     }
 #endif
+  else if (streq (p[0], "remote-override") && p[1])
+    {
+      VERIFY_PERMISSION (OPT_P_GENERAL);
+      options->remote_override = p[1];
+    }
   else if (streq (p[0], "remote") && p[1])
     {
       struct remote_entry re;
@@ -4417,7 +4422,7 @@ add_option (struct options *options,
       re.remote_port = re.proto = -1;

       VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
-      re.remote = p[1];
+      re.remote = options->remote_override ? options->remote_override : p[1];
       if (p[2])
        {
          const int port = atoi (p[2]);
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index d2ad94c..db1d3f7 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -215,6 +215,8 @@ struct options

   struct remote_host_store *rh_store;

+  const char *remote_override;
+
   bool remote_random;
   const char *ipchange;
   const char *dev;
-- 
1.8.1.5


Reply via email to