From patchwork Tue Feb 15 03:54:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 2291 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.30.191.6]) by backend41.mail.ord1d.rsapps.net with LMTP id UMTRLeS+C2JXRgAAqwncew (envelope-from ) for ; Tue, 15 Feb 2022 09:55:32 -0500 Received: from proxy4.mail.ord1d.rsapps.net ([172.30.191.6]) by director11.mail.ord1d.rsapps.net with LMTP id YLs4M+S+C2I8agAAvGGmqA (envelope-from ) for ; Tue, 15 Feb 2022 09:55:32 -0500 Received: from smtp27.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy4.mail.ord1d.rsapps.net with LMTPS id 6AaJMuS+C2KqEwAAiYrejw (envelope-from ) for ; Tue, 15 Feb 2022 09:55:32 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp27.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=lichtenheld.com X-Suspicious-Flag: YES X-Classification-ID: 525e0ca2-8e6f-11ec-9e95-b8ca3a655ab8-1-1 Received: from [216.105.38.7] ([216.105.38.7:43036] helo=lists.sourceforge.net) by smtp27.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 4E/F3-23229-3EEBB026; Tue, 15 Feb 2022 09:55:32 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nJzE1-00031x-KF; Tue, 15 Feb 2022 14:54:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nJzE0-00031r-G1 for openvpn-devel@lists.sourceforge.net; Tue, 15 Feb 2022 14:54:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2H24pkZoSPd0EdK/7j3paI/gLxMxO8qxZeLudepymAo=; b=GJ+PiEuhEIC1oafvlh1J8ZGYPs dNlCT9VRuW940KKyyU9meEnWPkuSY9TGBiYyqnwQR/zk6cFVRUcbfvBGxvpALIqrwjS03G+ZmA2Sm BIGLt5KwsmBpH/BPkegxagAu6qFoB1LbpqUyWQxx2MtVgSTHGk/73BpTqPpswLDS4m0c=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2H24pkZoSPd0EdK/7j3paI/gLxMxO8qxZeLudepymAo=; b=l+lRXTtKzFtUIEzPDECPSPwKO0 Sar61SYGVUmbkzWsX4NxfG7K0fWnCyC+9FMq+J6710TC6oVpNMC4q0Ta7YBMrLCWWKLYWCIgUVX2n +4ytu7lM6KQGGHEk1ABJwyZQhMSEQ5ST/RpaHXcKTzccFsqDO9mWqGHvs9/zObAFMU5o=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nJzDy-002qMg-1a for openvpn-devel@lists.sourceforge.net; Tue, 15 Feb 2022 14:54:39 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4JykdL3WfRz9sT2; Tue, 15 Feb 2022 15:54:30 +0100 (CET) From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 15 Feb 2022 15:54:25 +0100 Message-Id: <20220215145425.1989-1-frank@lichtenheld.com> In-Reply-To: <1155495853.307825.1644488506153@office.mailbox.org> References: <1155495853.307825.1644488506153@office.mailbox.org> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The family specific options were generally omitted. Cc: David Sommerseth Signed-off-by: Frank Lichtenheld --- doc/man-sections/client-options.rst | 10 ++++++++++ doc/man-sections/link-options. [...] Content analysis details: (-0.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.241.56.152 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1nJzDy-002qMg-1a Subject: [Openvpn-devel] [PATCH 3/3 v3] doc/options: clean up documentation for --proto and related options X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The family specific options were generally omitted. Cc: David Sommerseth Signed-off-by: Frank Lichtenheld Acked-By: David Sommerseth --- doc/man-sections/client-options.rst | 10 ++++++++++ doc/man-sections/link-options.rst | 5 ++++- src/openvpn/options.c | 17 +++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) v2: move #define around v3: reword --proto-force with input from David diff --git a/doc/man-sections/client-options.rst b/doc/man-sections/client-options.rst index c7cec176..e53b5262 100644 --- a/doc/man-sections/client-options.rst +++ b/doc/man-sections/client-options.rst @@ -199,6 +199,16 @@ configuration. When iterating through connection profiles, only consider profiles using protocol ``p`` (:code:`tcp` \| :code:`udp`). + Note that this specifically only filters by the transport layer + protocol, i.e. UDP or TCP. This does not affect whether IPv4 or + IPv6 is used as IP protocol. + + For implementation reasons the option accepts the :code:`4` and :code:`6` + suffixes when specifying the protocol + (i.e. :code:`udp4` / :code:`udp6` / :code:`tcp4` / :code:`tcp6`). + However, these behave the same as without the suffix and should be avoided + to prevent confusion. + --pull This option must be used on a client which is connecting to a multi-client server. It indicates to OpenVPN that it should accept diff --git a/doc/man-sections/link-options.rst b/doc/man-sections/link-options.rst index 52df843d..782aa738 100644 --- a/doc/man-sections/link-options.rst +++ b/doc/man-sections/link-options.rst @@ -289,7 +289,10 @@ the local and the remote host. --proto p Use protocol ``p`` for communicating with remote host. ``p`` can be - :code:`udp`, :code:`tcp-client`, or :code:`tcp-server`. + :code:`udp`, :code:`tcp-client`, or :code:`tcp-server`. You can also + limit OpenVPN to use only IPv4 or only IPv6 by specifying ``p`` as + :code:`udp4`, :code:`tcp4-client`, :code:`tcp4-server` or :code:`udp6`, + :code:`tcp6-client`, :code:`tcp6-server`, respectively. The default protocol is :code:`udp` when ``--proto`` is not specified. diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 92aeba3d..7ce0ba61 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -126,9 +126,11 @@ static const char usage_message[] = "--remote-random-hostname : Add a random string to remote DNS name.\n" "--mode m : Major mode, m = 'p2p' (default, point-to-point) or 'server'.\n" "--proto p : Use protocol p for communicating with peer.\n" - " p = udp (default), tcp-server, or tcp-client\n" + " p = udp (default), tcp-server, tcp-client\n" + " udp4, tcp4-server, tcp4-client\n" + " udp6, tcp6-server, tcp6-client\n" "--proto-force p : only consider protocol p in list of connection profiles.\n" - " p = udp6, tcp6-server, or tcp6-client (ipv6)\n" + " p = udp or tcp\n" "--connect-retry n [m] : For client, number of seconds to wait between\n" " connection retries (default=%d). On repeated retries\n" " the wait time is exponentially increased to a maximum of m\n" @@ -2300,6 +2302,8 @@ options_postprocess_verify_ce(const struct options *options, */ if (options->mode == MODE_SERVER) { +#define USAGE_VALID_SERVER_PROTOS "--mode server currently only supports " \ + "--proto values of udp, tcp-server, tcp4-server, or tcp6-server" #ifdef TARGET_ANDROID msg(M_FATAL, "--mode server not supported on Android"); #endif @@ -2317,15 +2321,14 @@ options_postprocess_verify_ce(const struct options *options, } if (!(proto_is_udp(ce->proto) || ce->proto == PROTO_TCP_SERVER)) { - msg(M_USAGE, "--mode server currently only supports " - "--proto udp or --proto tcp-server or proto tcp6-server"); + msg(M_USAGE, USAGE_VALID_SERVER_PROTOS); } #if PORT_SHARE if ((options->port_share_host || options->port_share_port) && (ce->proto != PROTO_TCP_SERVER)) { msg(M_USAGE, "--port-share only works in TCP server mode " - "(--proto tcp-server or tcp6-server)"); + "(--proto values of tcp-server, tcp4-server, or tcp6-server)"); } #endif if (!options->tls_server) @@ -2369,9 +2372,7 @@ options_postprocess_verify_ce(const struct options *options, } if (!(proto_is_dgram(ce->proto) || ce->proto == PROTO_TCP_SERVER)) { - msg(M_USAGE, - "--mode server currently only supports --proto udp or --proto " - "tcp-server or --proto tcp6-server"); + msg(M_USAGE, USAGE_VALID_SERVER_PROTOS); } if (!proto_is_udp(ce->proto) && (options->cf_max || options->cf_per)) {