From patchwork Fri Nov 10 10:22:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3422 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:50e4:b0:f2:62eb:61c1 with SMTP id r4csp1067655dyd; Fri, 10 Nov 2023 02:23:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0R4gZ7db0IEyTkSOOaI/Ydr90VVP2Ie3TL/8azL/DqfsJMJsQdXuunPHE7ht+8jYq9zE0 X-Received: by 2002:a17:90a:df16:b0:280:4da8:97a2 with SMTP id gp22-20020a17090adf1600b002804da897a2mr7248624pjb.3.1699611787785; Fri, 10 Nov 2023 02:23:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699611787; cv=none; d=google.com; s=arc-20160816; b=qPmHcCg5FWvB+UcDwK2w+vMBN1DC1ooXxTytLfR2NHG3ByJSnviwypAmS3Ynn//stn Fv8uDJyLa6b8M5FhZtUyZKkX9E4jY94p5oiijo+pmB+kfHRXgU+AL6ZoDF9Tt2CpA6yO kx/SYxSkkLGnws49MKSkL+hMb//JkLvxI96OkghVbox4TfnjRjFf2Sztd5OW39HsVfx3 Ss6bqP/Db4Vtgwqaau8wCluO28pjeMy90pxi7LaJ0MzwGVE8GJ4XC/WiqY2dRTDigmxr PjIJhPhjgSuVWWipCK9SHgsuKFRi2NRXJfJvxeRALeZUL9rDK5j6iAIH4mgbdnp7wE7Q uhdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=a/hEcmWqjTX5u0krl12FAV4cBXj/9Q1Ds0/ehYc6pqM=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=JTmGWB94HaFEASge2uxZd5KC3M2SFamMMa0GOwlYeNzzN1XYFuRK8o4SHZm0DefsVp +Z1qQ8j+WdNx0G9L6QxcDYNhwkexblDnPZdiavemWhRcYZjYc6A7iJPUQHVk9VS79oWN Huo9pc8CH+y6TGLOKWsF1mYHM/5S1QwCQ4tikqAwPvzvL69aFWxyUEr+zw2TrdrMwUBO qLnMntUfF7OlOGSLXutC8bzJSSU2qd9Zz0NeZcE3LglRAq2pK2OpJWYAhyFpaQAMxCGk fFLwdeWglBcEc415PUVsUGSdF8Ebt3RIuYQ/cSlTR24ruxzoDTtSxUifcZXT1aUng19K vREw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EXk9i+ln; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=R+Cm+BzK; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=SSsTL37e; 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=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id ob18-20020a17090b391200b002802f5bf238si4411255pjb.31.2023.11.10.02.23.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Nov 2023 02:23:07 -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=EXk9i+ln; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=R+Cm+BzK; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=SSsTL37e; 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=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1r1OeZ-0002m9-Sy; Fri, 10 Nov 2023 10:22:18 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r1OeU-0002m2-Cc for openvpn-devel@lists.sourceforge.net; Fri, 10 Nov 2023 10:22:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iEz934U8DSK1rWOTxpCnNhHcKkPl79ElusT+P1VEjnc=; b=EXk9i+lnlrUPgnhAPvX2jZDquL tsD9lYKWYu93Tsan3X/IbgC+vJ8/PEy6ngNMjSR79Ap0zl5YdL/O/iOUZqowBcvv48g07Hllysu/L eaM1E0CFmv7Qpxt4D6D/rqdtyus7l4V8Vq04A2zBIZODYIbfH4RGtYmxkFFel3J4aTFY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=iEz934U8DSK1rWOTxpCnNhHcKkPl79ElusT+P1VEjnc=; b=R +Cm+BzKMileUhnGlvdQsgnwlWJClTsZw8AfllT9R+w0ttuCvmacxnWkZZDreJnnbMP6V3e+5wUyEt Rfl8poR6f8xPB1F5GbvYC8z14zDuRQMJ4yO/MXG/N58ILdqUxAABdetsVF3szmuORe+YOoGQdxAuh Xh0OR2VHfC23vkiI=; Received: from mail-wm1-f48.google.com ([209.85.128.48]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1r1OeO-000riF-Rt for openvpn-devel@lists.sourceforge.net; Fri, 10 Nov 2023 10:22:13 +0000 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4081ccf69dcso17947085e9.0 for ; Fri, 10 Nov 2023 02:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1699611722; x=1700216522; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=iEz934U8DSK1rWOTxpCnNhHcKkPl79ElusT+P1VEjnc=; b=SSsTL37epBaQEUITPJI4yQCJy+VzBWXBFU3AZwCN5iKxZF8d+dncLsSAPulGBqQB6s Wp9IiVevP9dCxdQcgqOMUuRgYh1Su4RjuOHeuHLCtGfC+3OszLxN7McQnvC4VKX96mZ/ fYLV0Io695XP4BUXxcDr7YTZGURUJAb/xukgJGbhkTRgDCysWq2n0jN9EGCgpijx+XpM 7mIVAdnS1jQ7nyw9h44LgGquZji9TUUXtV9d76Y11cNLI/lHhkRd7dPJ4ptVM0dqg//h DocRzM6RSOV8dPMjfy+QzF9dx5MJ1ZBsF/QIz3S6/HbWO1MKSExlFp014biImUHyuRWt CuBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699611722; x=1700216522; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iEz934U8DSK1rWOTxpCnNhHcKkPl79ElusT+P1VEjnc=; b=LdRoAkGtY631qgsL0wGk8yJhKsK05G2JkD4ybvUOd9QlspepTQrXaja3TjezVZQiKs qAqb5JO1cx9D3hBds+pfjgCumE2dSaJL++iOYMuH/syDReXKgAQZov6/VaA/WfEnc03m /kV4NHL/ZUMmjmIsKaeoHL0+Du13y3qZHBJLXkOlH5C+FaGwui12zoPam6d424aXn13v 7tB9jpCh/IWBPNOwi2TFSfcDvdnfN4MDdZbtueBsjmqowiWi6PhSXeFM+tiBF60vdYwE F90fIGI6KI99rHxQxkp82QEFN5gfm0jwlu2RI1SYxkuCUWyRrNGbu2/8wzo9vW3XSzxJ 7HSQ== X-Gm-Message-State: AOJu0Yz/Nd34nR0eQY+7puZK0hkhmyCRrGB5mn5k+BEzuiUSZWq8wDy2 hgdMTyn4FpptXmZexB7EUZGAxAYnT+ZYs25Mh0E= X-Received: by 2002:a05:6000:186a:b0:32f:a254:c8b2 with SMTP id d10-20020a056000186a00b0032fa254c8b2mr2047580wri.20.1699611721740; Fri, 10 Nov 2023 02:22:01 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id e20-20020a05600c219400b004083996dad8sm4637366wme.18.2023.11.10.02.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 02:22:01 -0800 (PST) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 10 Nov 2023 10:22:00 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 X-Gerrit-Change-Number: 424 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 963de2058681e0bf243df6e502a41d9980df4596 References: Message-ID: <22dd9645e6a03528572fdad3c6abcf5501935985-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.48 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1r1OeO-000riF-Rt Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: 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: , Reply-To: lstipakov@gmail.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1782172129514876428?= X-GMAIL-MSGID: =?utf-8?q?1782172129514876428?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/424?usp=email to review the following change. Change subject: Warn if pushed options require DHCP ...................................................................... Warn if pushed options require DHCP 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. While on it, indicate that "--dns search-domains" option requires DHCP. Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Signed-off-by: Lev Stipakov --- M src/openvpn/options.c M src/openvpn/tun.c 2 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/424/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index e793a96..3b09d3e 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2483,10 +2483,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-options (or --dns) 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..986134c 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-options or --dns require DHCP server, which is not supported by the selected %s driver. Expect them not to work.", + print_windows_driver(tt->windows_driver)); + } + /* dco-win already opened the device, which handle we treat as socket */ if (tuntap_is_dco_win(tt)) {