Skip to content

Commit d6a0cf5

Browse files
schwabecron2
authored andcommitted
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. While at it, remove an unused macro (PUSH_DEFINED). Change-Id: I82c7c61be07593ecd5bf2f854767dda74ab5170c Signed-off-by: Arne Schwabe <[email protected]> Acked-by: Frank Lichtenheld <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1288 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg33856.html Signed-off-by: Gert Doering <[email protected]>
1 parent c0d96fd commit d6a0cf5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

doc/man-sections/server-options.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ fast hardware. SSL/TLS authentication must be used in this mode.
497497
``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``,
498498
``--rcvbuf``, ``--session-timeout``
499499

500+
Note: using ``--push`` requires OpenVPN to run in ``--mode server`` (or
501+
using of one of `--server`, `--server-bridge` helper directives).
502+
500503
--push-remove opt
501504
Selectively remove all ``--push`` options matching "opt" from the option
502505
list for a client. ``opt`` is matched as a substring against the whole

src/openvpn/options.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,6 +2690,13 @@ options_postprocess_verify_ce(const struct options *options, const struct connec
26902690
MUST_BE_UNDEF(vlan_accept, "vlan-accept");
26912691
MUST_BE_UNDEF(vlan_pvid, "vlan-pvid");
26922692
MUST_BE_UNDEF(force_key_material_export, "force-key-material-export");
2693+
2694+
if (options->push_list.head)
2695+
{
2696+
msg(M_WARN, "Note: Using --push without --mode server is an "
2697+
"unsupported configuration. Negotiation of OpenVPN "
2698+
"features is expected to fail.");
2699+
}
26932700
}
26942701

26952702
/*

src/openvpn/options.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,16 +768,11 @@ struct options
768768
#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
769769

770770
#define PULL_DEFINED(opt) ((opt)->pull)
771-
#define PUSH_DEFINED(opt) ((opt)->push_list)
772771

773772
#ifndef PULL_DEFINED
774773
#define PULL_DEFINED(opt) (false)
775774
#endif
776775

777-
#ifndef PUSH_DEFINED
778-
#define PUSH_DEFINED(opt) (false)
779-
#endif
780-
781776
#ifdef _WIN32
782777
#define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
783778
#else

0 commit comments

Comments
 (0)