From patchwork Mon Nov 13 16:01:33 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: 3428 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:3c06:b0:f2:62eb:61c1 with SMTP id e6csp1554917dys; Mon, 13 Nov 2023 08:02:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFerWvOWURx1l9wbD3ZjRSQuwn7vLJbrhk/2Cj24wyZKoHwqoB/F9QAs6U/ps0lc8/qDvrT X-Received: by 2002:a05:6808:2191:b0:3a9:e8e2:579d with SMTP id be17-20020a056808219100b003a9e8e2579dmr8095825oib.2.1699891332420; Mon, 13 Nov 2023 08:02:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699891332; cv=none; d=google.com; s=arc-20160816; b=lX9zd3eE+BsmlU9y4SNnAzU4QtUp+LLX7HXfJGNYUgWQwf9uqLn5cMmMnrn7KhsjeC vxecWNB1C6Pm2u74UJ91ezzSJ5S0+xiAwsYYdmUCRWk7Wew3HJ1Jfv/QOeXmoAcIazyW cY6RCPASb56aUsrhdk45iakW2iwCDH7R6191wPSGD2pgfAo16PzAYBjvz5ZwOsOPkGlX E3esAJpjwXQfsLIWZxe9lrXMQplcomALlZR0OG+84onUsIUHlsD20cCAgUVyJgGEKo4w HOx+j0c6f6J+CZUdRlzKs44ppvKi87Dz5cR8qJ6YgFog9BqNQjFs/Nq0OHXuPjoeFwqS 2yeQ== 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=+OrSVNwY5sp/Hq8o5kRAbapqBOaSeK8XmSu5Q9whpyM=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=tACygOArUbV6apyTAZlNGykS0GronGMDLfxO+DyJwN8izsH3n973d6tK1O13pmWuzn wVfamN9iCafRExdceYTDXhyUeof6qhEamBYpn3v2YJIgNrSOMk9y1nGHtvOA9UsAFEov CXKKD915ozwoQYokmb2LMTkAbIWHozjRmVZdq2Wyd87rb3E+Ras1aBSnRjIW6xGCDTe5 W9dCbad6wCHKEkWodKGeBz68N20CFbVnbS7JZOU5XRu5s0YuAFNgyN1UrUCCBZsFvCG4 LOg3bY8jRn/NncBJzdLSUcPtfw6RaoWXSCrvNQT1l6HBbJuqM2YQw+IJ89rLXWj3l3nZ JWVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bx7zJL2S; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FJUeCGIe; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=ZYSPwyVV; 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 v23-20020a544497000000b003b2a5d1d89fsi1764650oiv.255.2023.11.13.08.02.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 08:02:12 -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=bx7zJL2S; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FJUeCGIe; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=ZYSPwyVV; 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 1r2ZNi-0002Ur-FU; Mon, 13 Nov 2023 16:01:45 +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 1r2ZNg-0002Ul-MI for openvpn-devel@lists.sourceforge.net; Mon, 13 Nov 2023 16:01:43 +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=GYY44iDWgYo8Sc2cGiSLcLwiW+9S3dRALfABl4sQWcU=; b=bx7zJL2ShRlboTu8A8uhU9wCUL JJucsPtYN2nZbXEM9LFz/rqRO6dEvYoi58OAH1dRLb2If+yR0EBfSRuYaFpyv67htsHaOK04Eplos us8kFEo/C8CGXEqBkSaXElTNaWe5giaJAcNydtH751Hih6U355ECObpzWq9Ck6AbE0j0=; 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=GYY44iDWgYo8Sc2cGiSLcLwiW+9S3dRALfABl4sQWcU=; b=F JUeCGIe5jpwFL0FRafkO5xWwTvH9HcpU20Z64cZ5DWnP9XTANlRjbEPPz+jB1ToQpipMtmZo6X6zI amdE6g5RacX6Lur6SDOz36F/jBl90MIKa1/vNDGjB+iZgzNWLl2gLLZJ0SA5HX3MhdEOto4MGuAiN 7RYhKESyMPOJFx+U=; Received: from mail-wm1-f52.google.com ([209.85.128.52]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1r2ZNd-0003eu-P9 for openvpn-devel@lists.sourceforge.net; Mon, 13 Nov 2023 16:01:43 +0000 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40906fc54fdso37747605e9.0 for ; Mon, 13 Nov 2023 08:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1699891295; x=1700496095; 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=GYY44iDWgYo8Sc2cGiSLcLwiW+9S3dRALfABl4sQWcU=; b=ZYSPwyVV6SgGokg71+zlaoGCb9mBPvn3O5kRqcwmZ/6vkzISdGkTc86fOLkd2UBMl7 7k84IDwBKkF37lKZ7tLuvP+bbAFcd+dEvcEw3Y2Yoj9dFwRg27NG4VZd0HT8I49BkIqu hyERMobNnE5gafCjHe/MeXzClz0IOj6faQLv7iThAWLhybs8RC+XUQ/x9VMXdPVo1msi nqv4KnV89IE2ap1IAiggnuYghKNg6eEt0eCQnkzqJ3YjCod4M2ByIzzUpBfF9ke209mB FquElSreSxr78j5GZfKIpoI9hfE8t9+TR5sAeeUUMjbFcrT7+aanuqA/B5Wt+rKvqXEJ xTFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699891295; x=1700496095; 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=GYY44iDWgYo8Sc2cGiSLcLwiW+9S3dRALfABl4sQWcU=; b=NRwQIutPbKCQAyHknz5maLP34N4hqK5begXw/A1/K6XlPm7saSRqFqk+B7Ht9Wk9Dh MfkgT78KhrVXbpj1mrXn8j6IfrKkQVJXD8NAyO0rbLfKAVYdRg03tvTrSb5moFUFxLyQ 5zsKJsYrzwcuBCPBmDh+2iqK5it3/vZMXIlR69x+nUlpCqV0C/aGZFyugq7h682WX3/R mmjU3D+16oq3TRyjVc3LsSViDmB+JTioSAwyNR685ERjsEfm/ZQmBOnAZgSOAHZllp+m ZVSy2DyJfpDoSUPMcaN4qCGon0Fqt1YtQ1YpoJqRMDZIu1A2gWvGH+Ww28XUjEmkrVEg h8+A== X-Gm-Message-State: AOJu0YzQOBEBCnCFk16483WXlc+DLswVZJGoTco+TTPMdaZBcWkME/KW 5pf/d61T3yaRfywhmZAM6ayidjEw4b67rBAELSk= X-Received: by 2002:a05:600c:444a:b0:407:8e85:899f with SMTP id v10-20020a05600c444a00b004078e85899fmr5969893wmn.16.1699891294860; Mon, 13 Nov 2023 08:01:34 -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 bh7-20020a05600c3d0700b004068de50c64sm8589914wmb.46.2023.11.13.08.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 08:01:34 -0800 (PST) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 13 Nov 2023 16:01:33 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 X-Gerrit-Change-Number: 428 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 11f214a844e5f5b0f6701d9ee33eaf89838024b9 References: Message-ID: <2d92d801fa95fd2f3296f0d5e1ff56b58cb65985-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.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.52 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r2ZNd-0003eu-P9 Subject: [Openvpn-devel] [S] Change in openvpn[master]: 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?1782465253924077870?= X-GMAIL-MSGID: =?utf-8?q?1782465253924077870?= 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/+/428?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. 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/28/428/1 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)) {