From: "plaisthos (Code Review)" Date: Mon, 20 Oct 2025 16:20:13 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <98a205f0efaacd8396ff43ff664b07531d522374-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9QnNl6n5Z2o="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Warn if push is used without --mode server/--server/--server-bridge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --9QnNl6n5Z2o= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld,=20 I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: Warn if push is used without --mode server/--server/--serve= r-bridge ...................................................................... Warn if push is used without --mode server/--server/--server-bridge This is not a supported configuration and will often work good enough to get a connection working but will operate more in a weird pre P2P negotiation compatibility way rather than actually negotiating protocol features. Also remove an anused macro. Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c Signed-off-by: Arne Schwabe --- M doc/man-sections/server-options.rst M src/openvpn/options.c M src/openvpn/options.h 3 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1288/2 diff --git a/doc/man-sections/server-options.rst b/doc/man-sections/server-= options.rst index ccc1374..347a251 100644 --- a/doc/man-sections/server-options.rst +++ b/doc/man-sections/server-options.rst @@ -497,6 +497,9 @@ ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``, ``--rcvbuf``, ``--session-timeout`` + Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or + using of one of `--server`, `--server-bridge` helper directives). + --push-remove opt Selectively remove all ``--push`` options matching "opt" from the option list for a client. ``opt`` is matched as a substring against the whole diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 65c6b3b..9c02a8c 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2690,6 +2690,13 @@ MUST_BE_UNDEF(vlan_accept, "vlan-accept"); MUST_BE_UNDEF(vlan_pvid, "vlan-pvid"); MUST_BE_UNDEF(force_key_material_export, "force-key-material-expor= t"); + + if (options->push_list.head) + { + msg(M_WARN, "Note: Using --push without --mode server is an " + "unsupported configuration. Negotiation of OpenVPN= " + "features is expected to fail."); + } } /* diff --git a/src/openvpn/options.h b/src/openvpn/options.h index 009904a..24253af 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -768,16 +768,11 @@ #define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE)) #define PULL_DEFINED(opt) ((opt)->pull) -#define PUSH_DEFINED(opt) ((opt)->push_list) #ifndef PULL_DEFINED #define PULL_DEFINED(opt) (false) #endif -#ifndef PUSH_DEFINED -#define PUSH_DEFINED(opt) (false) -#endif - #ifdef _WIN32 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK) #else -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1288?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c Gerrit-Change-Number: 1288 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --9QnNl6n5Z2o= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1288?usp=3Demail">View Chan= ge

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

Warn if push is used without=
 --mode server/--server/--server-bridge

This is not a supported conf= iguration and will often work good enough
to get a connection working bu= t will operate more in a weird pre P2P
negotiation compatibility way rat= her than actually negotiating
protocol features.

Also remove an a= nused macro.

Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170cSigned-off-by: Arne Schwabe <arne@...1227...>
---
M doc/man-se= ctions/server-options.rst
M src/openvpn/options.c
M src/openvpn/optio= ns.h
3 files changed, 10 insertions(+), 5 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/1= 288/2
diff --git a/doc/man-sections/server-options.rst b/doc/man-se=
ctions/server-options.rst
index ccc1374..347a251 100644
--- a/doc/man-sections/server-options.rst
+++ = b/doc/man-sections/server-options.rst
@@ -497,6 +497,9 @@
``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbu= f``,
``--rcvbuf``, ``--session-timeout``

+ Note: using ``-= -push`` requires OpenVPN to run in ``--mode server`` (or
+ using of one of `--server`, `--serve= r-bridge` helper directives).
+
--push-remove opt
Selectivel= y remove all ``--push`` options matching "opt" from the option
list for a client. ``opt`` is matched as a substring again= st the whole
diff --git a/src/openvpn/options.c b/src/openv= pn/options.c
index 65c6b3b..9c02a8c 100644
= --- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2690,6 +2690,13 @@
MUST_BE_UNDEF(= vlan_accept, "vlan-accept");
MUST_BE_UND= EF(vlan_pvid, "vlan-pvid");
MUST_BE_UNDE= F(force_key_material_export, "force-key-material-export");=
+
+ if (options->push_list.head)
+ {
+ msg(M_WARN, "Note:= Using --push without --mode server is an "

+ "unsupported conf= iguration. Negotiation of OpenVPN "
+ "features is expected to = fail.");
+ = }
}

/*=
diff --git a/src/openvpn/options.h b/src/openvpn/options.h=
index 009904a..24253af 100644
--- a/src/openvpn/o= ptions.h
+++ b/src/openvpn/options.h
@@ -76= 8,16 +768,11 @@
#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | = OPT_P_PULL_MODE))

#define PULL_DEFINED(o= pt) ((opt)->pull)
-#= define PUSH_DEFINED(opt) ((opt)->push_list)

= #ifndef PULL_DEFINED
#define PULL_DEFINED(opt) (fal= se)
#endif

-#ifndef PUSH_DEFINED
-#define PUSH_DEFINED(opt) (false)
-#endif
-
#ifdef _WIN32
#defin= e ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
#else

To view, visit change 1288. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82c7c61be07593ecd5bf2f85476= 7dda74ab5170c
Gerrit-Change-Number: 1288
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --9QnNl6n5Z2o=--