From patchwork Wed Nov 15 12:06:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3435 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:3c06:b0:f2:62eb:61c1 with SMTP id e6csp2868938dys; Wed, 15 Nov 2023 04:12:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFb9/a1DlBKLBIMPJLdxB3vICgy70Kodkq8L1bBrRVPvBb6q8ipqousTDe2RhZWZDlBY7w5 X-Received: by 2002:a05:6e02:1b05:b0:359:c1e4:9a1 with SMTP id i5-20020a056e021b0500b00359c1e409a1mr5790722ilv.2.1700050330856; Wed, 15 Nov 2023 04:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700050330; cv=none; d=google.com; s=arc-20160816; b=YlzI5at5OunCThTDmXjhu9lI2rTsbXSRzB9qLZlhmn6YapmBevlrtWtW7hkDbA9vHm MTKH+v5+RMa4KrNWlSb1Z1ToBx/Yg1JvXJIjTvTLnAv813HsfC64RWvXwJd1KmMAG48W E/pViHQ/+Rlh07VWT4Ar7gBJOBa/5DC+fFVfUiCOEKhdFfIg17h1765TS7RJNVpo+TLv SjCV7cgdxwVEVVPnrNoZ463hvEa+wycbha06oKyiYlbRXKjJEi+8cd+ioO1VK6ShlpN8 WUm2EgsTWRLUsQClibRBFYd/jp+ViSX8lxHYk5gDCe6xdIk0StAG49fsTceMxww+0zid 28LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=f2y0kBaOgMhHiLY1ycIM80/0snyw4WqlK9B4WtZksAA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=lwq6KnWav5bRMf9GjN9YpGLNsW31DUjXd2e8WbdYKbFnVmjngiD0BeGWgTngXUkDG9 1dWiFwzVkZbX1xBFLw9UfsON7KcYabbva7Jnl/dClyfsoY7kDZe0lD0veFeDWxDRwve4 T4FhNK/QZsEnwKDtJ2z2IVpo+gRwTzwVyhFj1fk4wFlxHHcTLWwZ2g7HD/V1GD/XU6wX +EcZsgC7if2Ku1LjJnYMrV4iihbVi50HMgklo56samsaUOHRcRvORQrZMfR4VDLlzl1L rhEjXeHXJSxbkogX9tsphNP9Ge6kPWp+mVnMP6uyaR2MmsvfK3oP7JmQCy/RjJuanKnd Dpkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nLUM91ru; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=f60uTdzD; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e186-20020a6369c3000000b005b82f3dcec6si9922270pgc.269.2023.11.15.04.12.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2023 04:12:10 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nLUM91ru; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=f60uTdzD; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de 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.95) (envelope-from ) id 1r3Ejo-0000B5-Rg; Wed, 15 Nov 2023 12:11:20 +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.95) (envelope-from ) id 1r3Ejn-0000Az-6W for openvpn-devel@lists.sourceforge.net; Wed, 15 Nov 2023 12:11:19 +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:To:From:Sender:Reply-To:Cc: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=JwA+hHccIpwKpX2xjDx+GhV0tuNEHNrDcBC+XfJ4RJY=; b=nLUM91ru5kvCrMGpB4OI9FXEAW U2HsEFb2M7vI3aSGFzKGXSntikvjv/DcVtisYpm+79KXxLd16ajRp5x9n09HyhlEhh4cBo6s3+3UT cA4yfZ4EBoDni13aOolxRYsNDKYFD/V+YbPxli6GXLyo9/WMETG02vNmF0dGlUO0c+KI=; 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:To:From:Sender:Reply-To:Cc: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=JwA+hHccIpwKpX2xjDx+GhV0tuNEHNrDcBC+XfJ4RJY=; b=f60uTdzD5omG1lbE+zJ+mRC6ei C8JjFAASrQk/9n8Xui2QFXjRTiPY7GGInNdVFtAZlkTxkbhg0ZN/AEZ9XGgV+luBFeRKOIDvst0NU +xAuP3MTNmU/3zAobA0Qa47KjjSUAxy/bSHXezWVvclS5iuG1LtZ2Ykt4Da0m9YnOtH8=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1r3Ejl-006R4y-4t for openvpn-devel@lists.sourceforge.net; Wed, 15 Nov 2023 12:11:19 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 3AFCBAMN009331 for ; Wed, 15 Nov 2023 13:11:10 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 3AFCBAb8009330 for openvpn-devel@lists.sourceforge.net; Wed, 15 Nov 2023 13:11:10 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 15 Nov 2023 13:06:56 +0100 Message-ID: <20231115120656.6825-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: From: Lev Stipakov Some pushed options (such as DOMAIN-SEARCH) require DHCP server to work. Warn user that some options will not work if the current driver (such as dco-win) doesn't support DHCP. Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r3Ejl-006R4y-4t Subject: [Openvpn-devel] [PATCH v1] Warn if pushed options require DHCP 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 X-GMAIL-THRID: =?utf-8?q?1782631975572013648?= X-GMAIL-MSGID: =?utf-8?q?1782631975572013648?= From: Lev Stipakov Some pushed options (such as DOMAIN-SEARCH) require DHCP server to work. Warn user that some options will not work if the current driver (such as dco-win) doesn't support DHCP. Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/428 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/options.c b/src/openvpn/options.c index abd2e0c..b34e2f6 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2477,10 +2477,10 @@ if (options->tuntap_options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) { - const char *prefix = "Some dhcp-options require DHCP server"; + const char *prefix = "Some --dhcp-option or --dns options require DHCP server"; if (options->windows_driver != WINDOWS_DRIVER_TAP_WINDOWS6) { - msg(M_USAGE, "%s, which is not supported by selected %s driver", + msg(M_USAGE, "%s, which is not supported by the selected %s driver", prefix, print_windows_driver(options->windows_driver)); } else if (options->tuntap_options.ip_win32_type != IPW32_SET_DHCP_MASQ diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index f857ed1..1b79d42 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6826,6 +6826,13 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt, openvpn_net_ctx_t *ctx) { + if ((tt->options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) + && tt->windows_driver != WINDOWS_DRIVER_TAP_WINDOWS6) + { + msg(M_WARN, "Some --dhcp-option or --dns options require DHCP server, which is not supported by the selected %s driver. They will be ignored.", + print_windows_driver(tt->windows_driver)); + } + /* dco-win already opened the device, which handle we treat as socket */ if (tuntap_is_dco_win(tt)) {