summaryrefslogtreecommitdiffstats
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2012-12-16 22:15:20 +0100
committerDavid Sommerseth <davids@redhat.com>2012-12-17 10:31:24 +0100
commit3b860cf27b9374f6ebe67ff21011661f8ec391c6 (patch)
tree164bfd481968e3eb0aca11eae088356f2511cfae /src/openvpn/options.c
parentf0e8997a874a89b3fe1f82109c443232e8967b01 (diff)
downloadopenvpn-3b860cf27b9374f6ebe67ff21011661f8ec391c6.tar.gz
openvpn-3b860cf27b9374f6ebe67ff21011661f8ec391c6.tar.xz
openvpn-3b860cf27b9374f6ebe67ff21011661f8ec391c6.zip
Fix option inconsistency warnings about "proto" and "tun-ipv6"
"tun-ipv6" is only sent in option string if running in point-to-point mode (= not --server and not --client or --pull), because in those scenarios it's usually pushed by the server, and the client does not yet have it when comparing options -> needless warning. Completely ignore "proto" values when comparing option strings - this is in preparation for removing proto from the option string in a future release, and to avoid warnings when 2.3 talks to this future release. Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: David Sommerseth <davids@redhat.com> Message-Id: 1355692520-24362-1-git-send-email-gert@greenie.muc.de URL: http://article.gmane.org/gmane.network.openvpn.devel/7194 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 33dbf51..8ca41a3 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2917,7 +2917,11 @@ options_string (const struct options *o,
buf_printf (&out, ",link-mtu %d", EXPANDED_SIZE (frame));
buf_printf (&out, ",tun-mtu %d", PAYLOAD_SIZE (frame));
buf_printf (&out, ",proto %s", proto2ascii (proto_remote (o->ce.proto, remote), true));
- if (o->tun_ipv6)
+
+ /* send tun_ipv6 only in peer2peer mode - in client/server mode, it
+ * is usually pushed by the server, triggering a non-helpful warning
+ */
+ if (o->tun_ipv6 && o->mode == MODE_POINT_TO_POINT && !PULL_DEFINED(o))
buf_printf (&out, ",tun-ipv6");
/*
@@ -3097,6 +3101,15 @@ options_warning_safe_scan2 (const int msglevel,
const char *b1_name,
const char *b2_name)
{
+ /* we will stop sending 'proto xxx' in OCC in a future version
+ * (because it's not useful), and to reduce questions when
+ * interoperating, we start not-printing a warning about it today
+ */
+ if (strncmp(p1, "proto ", 6) == 0 )
+ {
+ return;
+ }
+
if (strlen (p1) > 0)
{
struct gc_arena gc = gc_new ();