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, |
4410 | 4410 | options->force_connection_list = true; |
4411 | 4411 | } |
4412 | 4412 | #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 | } |
4413 | 4418 | else if (streq (p[0], "remote") && p[1]) |
4414 | 4419 | { |
4415 | 4420 | struct remote_entry re; |
… |
… |
add_option (struct options *options, |
4417 | 4422 | re.remote_port = re.proto = -1; |
4418 | 4423 | |
4419 | 4424 | VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION); |
4420 | | re.remote = p[1]; |
| 4425 | re.remote = options->remote_override ? options->remote_override : p[1]; |
4421 | 4426 | if (p[2]) |
4422 | 4427 | { |
4423 | 4428 | const int port = atoi (p[2]); |
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index d2ad94c..db1d3f7 100644
a
|
b
|
struct options |
215 | 215 | |
216 | 216 | struct remote_host_store *rh_store; |
217 | 217 | |
| 218 | const char *remote_override; |
| 219 | |
218 | 220 | bool remote_random; |
219 | 221 | const char *ipchange; |
220 | 222 | const char *dev; |