[Openvpn-devel,v2] Alias ADAPTER_DOMAIN_SUFFIX to DOMAIN

Message ID 20200922100021.20329-1-lstipakov@gmail.com
State Accepted
Headers show
Series [Openvpn-devel,v2] Alias ADAPTER_DOMAIN_SUFFIX to DOMAIN | expand

Commit Message

Lev Stipakov Sept. 22, 2020, midnight UTC
From: Lev Stipakov <lev@openvpn.net>

ADAPTER_DOMAIN_SUFFIX is an openvpn3 replacement for
DOMAIN, which is used there for split-dns. This option is pushed
by modern Access Server.

This change improves compatibility between OpenVPN
community client and Access Server.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---

 v2:
    - fixed long line in C code
    - left out --help change
    - slightly changed man text
 
 doc/man-sections/vpn-network-options.rst | 4 ++++
 src/openvpn/options.c                    | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Gert Doering Sept. 28, 2020, 11:26 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

I think this is reasonable for AS compatibility, which is 
desirable.  (Otherwise, I do have some reservation on
"why do we need to work around uncoordinated actions on the 
v3/AS side in the v2 source?")

I have not tested this besides "stare at source" and "compile
with MinGW", but it looks trivially correct enough.

Your patch has been applied to the master and release/2.5 branch.

commit d6720203fa9ba446497798a284c17093b92de1dc (master)
commit 2062876f3a4c87a552ce5d7cb68113e349a5c872 (release/2.5)
Author: Lev Stipakov
Date:   Tue Sep 22 13:00:21 2020 +0300

     Alias ADAPTER_DOMAIN_SUFFIX to DOMAIN

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20200922100021.20329-1-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21107.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/doc/man-sections/vpn-network-options.rst b/doc/man-sections/vpn-network-options.rst
index 825dd1ca..26682789 100644
--- a/doc/man-sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn-network-options.rst
@@ -114,6 +114,10 @@  routing.
   :code:`DOMAIN` ``name``
         Set Connection-specific DNS Suffix to :code:`name`.
 
+  :code:`ADAPTER_DOMAIN_SUFFIX` ``name``
+        Alias to :code:`DOMAIN`. This is a compatibility option, it
+        should not be used in new deployments.
+
   :code:`DOMAIN-SEARCH` ``name``
         Add :code:`name` to the domain search list.
         Repeat this option to add more entries. Up to
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 4b22d3d9..3df803db 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -7440,7 +7440,8 @@  add_option(struct options *options,
         VERIFY_PERMISSION(OPT_P_IPWIN32);
         bool ipv6dns = false;
 
-        if (streq(p[1], "DOMAIN") && p[2])
+        if ((streq(p[1], "DOMAIN") || streq(p[1], "ADAPTER_DOMAIN_SUFFIX"))
+            && p[2])
         {
             o->domain = p[2];
         }