Ticket #272: 0001-Added-remote-override-option.patch

File 0001-Added-remote-override-option.patch, 1.5 KB (added by Gert Döring, 11 years ago)
  • src/openvpn/options.c

    From 77b8467ab1fce6bb5ac6a4bda7891d72ea2654c0 Mon Sep 17 00:00:00 2001
    From: James Yonan <james@openvpn.net>
    Date: Mon, 13 Aug 2012 18:11:10 +0200
    Subject: [PATCH] Added remote-override option.
    
    OpenVPN SVN r8126 (2.1.20)
    
    Signed-off-by: Gert Doering <gert@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 b add_option (struct options *options, 
    44104410      options->force_connection_list = true;
    44114411    }
    44124412#endif
     4413  else if (streq (p[0], "remote-override") && p[1])
     4414    {
     4415      VERIFY_PERMISSION (OPT_P_GENERAL);
     4416      options->remote_override = p[1];
     4417    }
    44134418  else if (streq (p[0], "remote") && p[1])
    44144419    {
    44154420      struct remote_entry re;
    add_option (struct options *options, 
    44174422      re.remote_port = re.proto = -1;
    44184423
    44194424      VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
    4420       re.remote = p[1];
     4425      re.remote = options->remote_override ? options->remote_override : p[1];
    44214426      if (p[2])
    44224427        {
    44234428          const int port = atoi (p[2]);
  • src/openvpn/options.h

    diff --git a/src/openvpn/options.h b/src/openvpn/options.h
    index d2ad94c..db1d3f7 100644
    a b struct options 
    215215
    216216  struct remote_host_store *rh_store;
    217217
     218  const char *remote_override;
     219
    218220  bool remote_random;
    219221  const char *ipchange;
    220222  const char *dev;