]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
signal --dns support in peer info
authorHeiko Hund <heiko@ist.eigentlich.net>
Fri, 13 May 2022 09:37:40 +0000 (11:37 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 28 Jun 2022 12:19:36 +0000 (14:19 +0200)
Have clients set a bit in IV_PROTO, so that servers can make an informed
decision on whether to push --dns to the client. While unknown options
are ignored by clients when pushed, they generate a warning in the log.
That can be circumvented by server backends by checking if bit 7 is set.

Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20220513093740.1091639-1-heiko@ist.eigentlich.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24350.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl.c
src/openvpn/ssl.h

index 61dea996dccebe1839970998e5a2d4eb1a388300..24d7f3f4818f4e40b0f99f8cb975f11d4e3a7781 100644 (file)
@@ -1940,6 +1940,9 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
         /* support for P_DATA_V2 */
         int iv_proto = IV_PROTO_DATA_V2;
 
+        /* support for the --dns option */
+        iv_proto |= IV_PROTO_DNS_OPTION;
+
         /* support for receiving push_reply before sending
          * push request, also signal that the client wants
          * to get push-reply messages without without requiring a round
index 0ba86d3e6c59c34d78928553b4f883c09c19df02..c880270788cc798887aa979dcbe83968eb8ffc30 100644 (file)
@@ -93,6 +93,9 @@
  * result. */
 #define IV_PROTO_NCP_P2P         (1<<5)
 
+/** Supports the --dns option introduced in version 2.6 */
+#define IV_PROTO_DNS_OPTION      (1<<6)
+
 /* Default field in X509 to be username */
 #define X509_USERNAME_FIELD_DEFAULT "CN"