]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Check whether in pull_mode before warning about previous connection blocks
authorSelva Nair <selva.nair@gmail.com>
Fri, 15 Sep 2017 18:46:15 +0000 (14:46 -0400)
committerGert Doering <gert@greenie.muc.de>
Sat, 30 Sep 2017 17:19:23 +0000 (19:19 +0200)
In particular, this eliminates the message that says "explicit-exit-notify
is ignored by previous <connection> blocks" when the option is pushed.

Note: pull_mode is identified as "allowed & OPT_P_PULL_MODE" matching
with the definition in add_options().

Reported by: Eike Lohmann e.lohmann@ic3s.de
https://www.mail-archive.com/openvpn-users@lists.sourceforge.net/msg04052.h
tml

v2: move the check to verify_permissions() as suggested by
    Gert <gert@greenie.muc.de>

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <1505501175-9016-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15452.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 5f31e7eb0f7367e3bbdcd4da805039a99d5063d0..7aa311aa0a2d03e08d33c0ac605aaa76ad0bdec5 100644 (file)
@@ -4824,11 +4824,13 @@ verify_permission(const char *name,
 #ifndef ENABLE_SMALL
     /* Check if this options is allowed in connection block,
      * but we are currently not in a connection block
+     * unless this is a pushed option.
      * Parsing a connection block uses a temporary options struct without
      * connection_list
      */
 
-    if ((type & OPT_P_CONNECTION) && options->connection_list)
+    if ((type & OPT_P_CONNECTION) && options->connection_list
+        && !(allowed & OPT_P_PULL_MODE))
     {
         if (file)
         {