From patchwork Thu Dec 19 11:39:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 952 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id +GW9DHz8+11kDAAAIUCqbw for ; Thu, 19 Dec 2019 17:41:00 -0500 Received: from proxy19.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id kDcfCnz8+117DwAAIasKDg ; Thu, 19 Dec 2019 17:41:00 -0500 Received: from smtp21.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.iad3b.rsapps.net with LMTP id KMpeBHz8+10tVwAAIG4riQ ; Thu, 19 Dec 2019 17:41:00 -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: smtp21.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: a0171fe2-22b0-11ea-bb14-525400cdc90a-1-1 Received: from [216.105.38.7] ([216.105.38.7:52340] helo=lists.sourceforge.net) by smtp21.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 57/72-24396-A7CFBFD5; Thu, 19 Dec 2019 17:40:59 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ii4Sd-00068B-BI; Thu, 19 Dec 2019 22:39:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4SX-00067W-N7 for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:53 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=07zAKWoDlL6L+rw8xDEZm/F43ihZc0stMoop5235F9I=; b=fnjAdBUzRMEkeo6iWUcyIrg/hl 10iocvlEDKI6ZVCY726D3K2li3G/DB2x+jtcgLV0OaYl6NYITqmcAIQ0jZOn4VwwoXCzpQFerdW6a ne4QBpvs7RFTpvohVyUjhc1SU2thD7KUq+srt+wZ/yctborEV8KihDNGB+NdIsVIqI/U=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=07zAKWoDlL6L+rw8xDEZm/F43ihZc0stMoop5235F9I=; b=M FrIAK7ogiLOpFXfW5aanKi463xAqYyOdvY56DWWntZz7y9aFm5ZAqI4px71U8VAmayd/x5PWt+Sg1 IFNglMiJX1+9I992VA8RUHqRlsYfRNBQjIsoXlbwY4V0gfg548KAbsvoxJbg+0MbZa06S8+vXTvyw LsViSM1ggShryLCU=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4ST-007tdh-4E for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:51 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 4677B1002FB9; Thu, 19 Dec 2019 23:39:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795174; bh=07zAKWoDlL6L+rw8xDEZm/F43ihZc0stMoop5235F9I=; h=From:To:Cc:Subject:Date:From; b=ndastD2xBB3isviwOfnJAQG1RBPEVUPClmXn9B2PytqOQikD8HiOUhGjMoa1IuXGN oWQFeVQ5btiflCZQ1Tc1A9cU+5iXPvAezwxsEai0czQOyRQo7yxnQWX5gvztmryaBM /EkXYHvdkRH76UwOGYqovVe0j20D6V9PrqlBJb/o= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id C15BC1002FBA; Thu, 19 Dec 2019 23:39:30 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:11 +0100 Message-Id: <20191219223917.1614-1-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4ST-007tdh-4E Subject: [Openvpn-devel] [PATCH 1/7] tun.c: make Windows device lookup functions more general 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 Since the introduction of Wintun, not all network devices in Windows are TAP-Windows6. Rather than returning a simple true/false answer, a couple of functions were reworked to return a corresponding struct tap_reg * or NULL instead. As it would make the code `tr = is_tap_win(...)` a bit awkward those functions (both static) were renamed to better reflect their nature. Signed-off-by: Simon Rozman Acked-by: Lev Stipakov --- src/openvpn/tun.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index ad497a71..053a8232 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3976,10 +3976,10 @@ show_tap_win_adapters(int msglev, int warnlev) } /* - * Confirm that GUID is a TAP-Windows adapter. + * Lookup a TAP-Windows or Wintun adapter by GUID. */ -static bool -is_tap_win(const char *guid, const struct tap_reg *tap_reg) +static const struct tap_reg * +get_tap_by_guid(const char *guid, const struct tap_reg *tap_reg) { const struct tap_reg *tr; @@ -3987,11 +3987,11 @@ is_tap_win(const char *guid, const struct tap_reg *tap_reg) { if (guid && !strcmp(tr->guid, guid)) { - return true; + return tr; } } - return false; + return NULL; } static const char * @@ -4010,16 +4010,16 @@ guid_to_name(const char *guid, const struct panel_reg *panel_reg) return NULL; } -static const char * -name_to_guid(const char *name, const struct tap_reg *tap_reg, const struct panel_reg *panel_reg) +static const struct tap_reg * +get_tap_by_name(const char *name, const struct tap_reg *tap_reg, const struct panel_reg *panel_reg) { const struct panel_reg *pr; for (pr = panel_reg; pr != NULL; pr = pr->next) { - if (name && !strcmp(pr->name, name) && is_tap_win(pr->guid, tap_reg)) + if (name && !strcmp(pr->name, name)) { - return pr->guid; + return get_tap_by_guid(pr->guid, tap_reg); } } @@ -4116,6 +4116,7 @@ get_device_guid(const char *name, { struct buffer ret = alloc_buf_gc(256, gc); struct buffer actual = clear_buf(); + const struct tap_reg *tr; /* Make sure we have at least one TAP adapter */ if (!tap_reg) @@ -4131,7 +4132,8 @@ get_device_guid(const char *name, } /* Check if GUID was explicitly specified as --dev-node parameter */ - if (is_tap_win(name, tap_reg)) + tr = get_tap_by_guid(name, tap_reg); + if (tr) { const char *act = guid_to_name(name, panel_reg); buf_printf(&ret, "%s", name); @@ -4148,11 +4150,11 @@ get_device_guid(const char *name, /* Lookup TAP adapter in network connections list */ { - const char *guid = name_to_guid(name, tap_reg, panel_reg); - if (guid) + tr = get_tap_by_name(name, tap_reg, panel_reg); + if (tr) { buf_printf(&actual, "%s", name); - buf_printf(&ret, "%s", guid); + buf_printf(&ret, "%s", tr->guid); return BSTR(&ret); } } @@ -4696,11 +4698,14 @@ get_adapter_index_flexible(const char *name) /* actual name or GUID */ { const struct tap_reg *tap_reg = get_tap_reg(&gc); const struct panel_reg *panel_reg = get_panel_reg(&gc); - const char *guid = name_to_guid(name, tap_reg, panel_reg); - index = get_adapter_index_method_1(guid); - if (index == TUN_ADAPTER_INDEX_INVALID) + const struct tap_reg *tr = get_tap_by_name(name, tap_reg, panel_reg); + if (tr) { - index = get_adapter_index_method_2(guid); + index = get_adapter_index_method_1(tr->guid); + if (index == TUN_ADAPTER_INDEX_INVALID) + { + index = get_adapter_index_method_2(tr->guid); + } } } if (index == TUN_ADAPTER_INDEX_INVALID) From patchwork Thu Dec 19 11:39:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 950 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id SEiKOnn8+12dHwAAIUCqbw for ; Thu, 19 Dec 2019 17:40:58 -0500 Received: from proxy11.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id 4NLiN3n8+12CDwAAIasKDg ; Thu, 19 Dec 2019 17:40:58 -0500 Received: from smtp9.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3b.rsapps.net with LMTP id oB6NMXn8+13GTgAARNREpw ; Thu, 19 Dec 2019 17:40:57 -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: smtp9.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 9f39a2f2-22b0-11ea-82ad-525400f4d366-1-1 Received: from [216.105.38.7] ([216.105.38.7:42340] helo=lists.sourceforge.net) by smtp9.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 4E/41-29691-97CFBFD5; Thu, 19 Dec 2019 17:40:57 -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.90_1) (envelope-from ) id 1ii4Sg-0001LY-3P; Thu, 19 Dec 2019 22:40:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4SX-0001Ku-Mz for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:53 +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=HUayiAZ2Zc/H2KMe8NPKcszmFgmw/FhobYeS3246TyU=; b=cBT+eOQYhPX5IXzoLNfbKzvbpW h6DKhGv7NhhqJxjCR1Dyh14TX3ZO8aXhmX23lSTZUw00ke7RDu5fGsUdfjpK8kUhoOC767KXoeQdo D8sAj+osHj8i6/si0z06MY100OUR5EPXEKSclgamy/wNcEdJYW0VKH5V1Bl77pDF7tes=; 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=HUayiAZ2Zc/H2KMe8NPKcszmFgmw/FhobYeS3246TyU=; b=FFcx5oNzxrFtLzmw5zUriZj0d1 x/nmhIPyivhdMP+XCwDBGg93gzhbHgC2JWLaB8iRWe4pphjzw49+CVTFagyexsI7OaVLNUBzFNTad RlK6H1LLIzAlMMNHrsJilYu6ZdT8N3FXTaJYaHDkqxqoGpdo3P/NO4KNf35wTk+ZqfNc=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4ST-007tdl-3e for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:51 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id AAF53100449A; Thu, 19 Dec 2019 23:39:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795175; bh=HUayiAZ2Zc/H2KMe8NPKcszmFgmw/FhobYeS3246TyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W6NGcYwwcw/GhslAh4NrDPgUUv34vmWeWKwoU67mp7QoSrG+Rcy5fwBaw7fewzikM qbyVFjqURysUWppq9jYdsCaFrPGgPA+4uW2d29RHziqY5tXnQjcMrFTT//qoQSfCFn b4XLTUlYn/XQUIhM8R1+umRezYq8/ZSBTeiJvmN8= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id C85D01002FBB; Thu, 19 Dec 2019 23:39:30 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:12 +0100 Message-Id: <20191219223917.1614-2-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4ST-007tdl-3e Subject: [Openvpn-devel] [PATCH 2/7] tun.c: upgrade get_device_guid() to return the Windows driver type 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 Signed-off-by: Simon Rozman Acked-by: Lev Stipakov --- src/openvpn/tun.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 053a8232..623ed37b 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -4110,6 +4110,7 @@ static const char * get_device_guid(const char *name, char *actual_name, int actual_name_size, + bool *wintun, const struct tap_reg *tap_reg, const struct panel_reg *panel_reg, struct gc_arena *gc) @@ -4145,6 +4146,10 @@ get_device_guid(const char *name, { buf_printf(&actual, "%s", name); } + if (wintun) + { + *wintun = tr->wintun; + } return BSTR(&ret); } @@ -4154,6 +4159,10 @@ get_device_guid(const char *name, if (tr) { buf_printf(&actual, "%s", name); + if (wintun) + { + *wintun = tr->wintun; + } buf_printf(&ret, "%s", tr->guid); return BSTR(&ret); } @@ -4838,7 +4847,7 @@ tap_allow_nonadmin_access(const char *dev_node) if (dev_node) { /* Get the device GUID for the device specified with --dev-node. */ - device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), tap_reg, panel_reg, &gc); + device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), NULL, tap_reg, panel_reg, &gc); if (!device_guid) { @@ -5412,7 +5421,7 @@ netsh_get_id(const char *dev_node, struct gc_arena *gc) if (dev_node) { - guid = get_device_guid(dev_node, BPTR(&actual), BCAP(&actual), tap_reg, panel_reg, gc); + guid = get_device_guid(dev_node, BPTR(&actual), BCAP(&actual), NULL, tap_reg, panel_reg, gc); } else { @@ -6132,7 +6141,7 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui if (dev_node) { /* Get the device GUID for the device specified with --dev-node. */ - *device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), tap_reg, panel_reg, &gc); + *device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), NULL, tap_reg, panel_reg, &gc); if (!*device_guid) { From patchwork Thu Dec 19 11:39:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 949 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id cELKLXP8+11kDAAAIUCqbw for ; Thu, 19 Dec 2019 17:40:51 -0500 Received: from proxy11.mail.iad3b.rsapps.net ([172.31.255.6]) by director8.mail.ord1d.rsapps.net with LMTP id KEPJKnP8+11zHgAAfY0hYg ; Thu, 19 Dec 2019 17:40:51 -0500 Received: from smtp30.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3b.rsapps.net with LMTP id UMV1JHP8+13ITgAARNREpw ; Thu, 19 Dec 2019 17:40:51 -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: smtp30.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 9b4b0a96-22b0-11ea-90f2-525400502618-1-1 Received: from [216.105.38.7] ([216.105.38.7:52012] helo=lists.sourceforge.net) by smtp30.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 53/6E-03371-27CFBFD5; Thu, 19 Dec 2019 17:40:51 -0500 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ii4Sd-00042g-4x; Thu, 19 Dec 2019 22:39:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4SV-00041d-B8 for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:51 +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=fqjFB/77U+lKcZhKXoKQxvOjeRGjiEFE7NJYwB3o5iw=; b=T7IzDVnV0RXLge5BdNC28zNGcz gEbIYg9zuu0ORvnlweJX9FWl8pmJVcxeH0FyuLczwuZeFjoQV5RU4TMZZ5nu1UX/CWILHc+9vL3r4 4ccw94V3S6sNo7fsfSmc4jj/mRjyiBQae9maUi3CvM0TgVbOf2GgONEBxOrdHHpqTs8E=; 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=fqjFB/77U+lKcZhKXoKQxvOjeRGjiEFE7NJYwB3o5iw=; b=ND0kF78MB+tqsOZ3KHI+qnMnLn CFh9ZLicJ9B/PW/2eMCedK5dDpItrzTysCqzwmfTAlTdzPEoC/kJedWioNTyFt8xUVTKH3GSF033e 53qIzNSHHgWlXt23Rl2JWBYarErf0PtjnRE/aWqpJD7BO1obLheq0H8sYSwBqLgL5ysw=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4ST-007tdn-5d for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:51 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id CD4501002FBB; Thu, 19 Dec 2019 23:39:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795176; bh=fqjFB/77U+lKcZhKXoKQxvOjeRGjiEFE7NJYwB3o5iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bX8VW15NQKDTDa1grEVwlemcbUcq5SQuBd16K40JhEZ91YYmnImWxiOVMuvYWXWfE PfFP8MgtDppz6benUWRD9fgOEMyaBkS9SXvyHBKFowXTemnVextr3nzPVWhfNmjrYu JA7VJ6Bac3+fc6jqCLmY+utee1uNOaBzKjk5xMLo= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id D56B41002FBC; Thu, 19 Dec 2019 23:39:30 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:13 +0100 Message-Id: <20191219223917.1614-3-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4ST-007tdn-5d Subject: [Openvpn-devel] [PATCH 3/7] tun.c: make wintun_register_ring_buffer() non-fatal on failures 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 Wintun allows multiple handles to be opened on it's NDIS device pipe. Just by succeeding to open the pipe does not warrant the adapter is unused. When iterating for available Wintun adapter, we will need to try registering ring buffers with each one to actually determine which one is used and which one is not. Therefore, a failure to register ring buffers should be detectable, but not M_FATAL. Signed-off-by: Simon Rozman Acked-by: Lev Stipakov --- src/openvpn/tun.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 623ed37b..220dee87 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5647,11 +5647,12 @@ register_dns_service(const struct tuntap *tt) gc_free(&gc); } -static void +static bool service_register_ring_buffers(const struct tuntap *tt) { HANDLE msg_channel = tt->options.msg_channel; ack_message_t ack; + bool ret = true; struct gc_arena gc = gc_new(); register_ring_buffers_message_t msg = { @@ -5669,13 +5670,13 @@ service_register_ring_buffers(const struct tuntap *tt) if (!send_msg_iservice(msg_channel, &msg, sizeof(msg), &ack, "Register ring buffers")) { - gc_free(&gc); - return; + ret = false; } else if (ack.error_number != NO_ERROR) { - msg(M_FATAL, "Register ring buffers failed using service: %s [status=0x%x]", + msg(M_NONFATAL, "Register ring buffers failed using service: %s [status=0x%x]", strerror_win32(ack.error_number, &gc), ack.error_number); + ret = false; } else { @@ -5683,6 +5684,7 @@ service_register_ring_buffers(const struct tuntap *tt) } gc_free(&gc); + return ret; } void @@ -5922,9 +5924,11 @@ tuntap_set_ip_addr(struct tuntap *tt, gc_free(&gc); } -static void +static bool wintun_register_ring_buffer(struct tuntap *tt) { + bool ret = true; + tt->wintun_send_ring = (struct tun_ring *)MapViewOfFile(tt->wintun_send_ring_handle, FILE_MAP_ALL_ACCESS, 0, @@ -5939,7 +5943,7 @@ wintun_register_ring_buffer(struct tuntap *tt) if (tt->options.msg_channel) { - service_register_ring_buffers(tt); + ret = service_register_ring_buffers(tt); } else { @@ -5953,13 +5957,16 @@ wintun_register_ring_buffer(struct tuntap *tt) tt->rw_handle.read, tt->rw_handle.write)) { - msg(M_FATAL, "ERROR: Failed to register ring buffers: %lu", GetLastError()); + msg(M_NONFATAL, "Failed to register ring buffers: %lu", GetLastError()); + ret = false; } if (!RevertToSelf()) { msg(M_FATAL, "ERROR: RevertToSelf error: %lu", GetLastError()); } } + + return ret; } static void @@ -6367,7 +6374,10 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun if (tt->wintun) { - wintun_register_ring_buffer(tt); + if (!wintun_register_ring_buffer(tt)) + { + msg(M_FATAL, "Failed to register ring buffers"); + } } else { From patchwork Thu Dec 19 11:39:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 948 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2Mj1HXL8+10jLgAAIUCqbw for ; Thu, 19 Dec 2019 17:40:50 -0500 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id GLckG3L8+124UAAAovjBpQ ; Thu, 19 Dec 2019 17:40:50 -0500 Received: from smtp40.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTP id cOYbFXL8+12LLQAAhyf7VQ ; Thu, 19 Dec 2019 17:40:50 -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: smtp40.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 9ab1432a-22b0-11ea-b6bb-5254000cc6d4-1-1 Received: from [216.105.38.7] ([216.105.38.7:51984] helo=lists.sourceforge.net) by smtp40.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C9/43-16219-17CFBFD5; Thu, 19 Dec 2019 17:40:50 -0500 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ii4Sd-00042t-9K; Thu, 19 Dec 2019 22:39:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4SX-00041y-Si for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:53 +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=9Mrkeh9kyJKVNK6suSHMZIzwMlPJAjNsNBoJRHv5Eu8=; b=l/GNxU7IBWOP82n/ooOOZCo+vk 44yE/PtvjgeC1zNXbUXX+zQRUIlKHWYWVVoReXqoEkVcJOiBjWYYFDyUX2CBcrAYAdrhMBWQYBi1w 8Nqm0kVMrD0M/++p41sHYyZBhucOQJK0um5/TtjIQV201JqJUslKWoJJcvHUNjffzDZc=; 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=9Mrkeh9kyJKVNK6suSHMZIzwMlPJAjNsNBoJRHv5Eu8=; b=i+YSZ9CVnO7OFReidgb+e1X3Kw XONp7IQGpL2Y4H05OvPVB1JIGUVwca+sNLc5VE2xOwGSUxQsLaDWTsDL7qnIAazoi1oWGeADaa7KU /pQ7fTjnLkz5mN4gr4nNNcguxuJatVTPyecTx/FH3C6bX2zp9fdTSSxWqwX4uXCweG+o=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4SV-00AO0u-Hx for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id EDDCB1002FBA; Thu, 19 Dec 2019 23:39:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795177; bh=9Mrkeh9kyJKVNK6suSHMZIzwMlPJAjNsNBoJRHv5Eu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IpYFE74iOgJHHfp15dS09sJFR9hM561+T1W9waPOs08Ndl4fvJy3c+SLb8KoKPzAj OAcgDmwIF/UmSnukQTUxOCvx2ombZ+AfWePtn2aGCujfAGVOIMGuNtNgO9e9zouPJ4 Y/2zIt3lSkCjVrGbVs7otx9JBUcd3WY9yA8GfLIg= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id E3FE11002FBD; Thu, 19 Dec 2019 23:39:30 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:14 +0100 Message-Id: <20191219223917.1614-4-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4SV-00AO0u-Hx Subject: [Openvpn-devel] [PATCH 4/7] wintun: register ring buffers when iterating adapters 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 Wintun adapters may be considered available if ring buffer registration succeeded. Therefore, we must attempt to register ring buffers when iterating adapters and continue on failure. Signed-off-by: Simon Rozman --- src/openvpn/tun.c | 110 +++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 46 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 220dee87..9dc9b3a2 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6129,11 +6129,71 @@ tuntap_dhcp_mask(const struct tuntap *tt, const char *device_guid) gc_free(&gc); } +static bool +tun_try_open_device(struct tuntap *tt, const char *device_guid, const struct device_instance_id_interface *device_instance_id_interface) +{ + const char *path = NULL; + char tuntap_device_path[256]; + + if (tt->wintun) + { + const struct device_instance_id_interface *dev_if; + + /* Open Wintun adapter */ + for (dev_if = device_instance_id_interface; dev_if != NULL; dev_if = dev_if->next) + { + if (strcmp(dev_if->net_cfg_instance_id, device_guid) == 0) + { + path = dev_if->device_interface_list; + break; + } + } + if (path == NULL) + { + return false; + } + } + else + { + /* Open TAP-Windows adapter */ + openvpn_snprintf(tuntap_device_path, sizeof(tuntap_device_path), "%s%s%s", + USERMODEDEVICEDIR, + device_guid, + TAP_WIN_SUFFIX); + path = tuntap_device_path; + } + + tt->hand = CreateFile(path, + GENERIC_READ | GENERIC_WRITE, + 0, /* was: FILE_SHARE_READ */ + 0, + OPEN_EXISTING, + FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, + 0); + + if (tt->hand == INVALID_HANDLE_VALUE) + { + msg(D_TUNTAP_INFO, "CreateFile failed on %s device: %s", tt->wintun ? "Wintun" : "TAP-Windows", path); + return false; + } + + if (tt->wintun) + { + /* Wintun adapter may be considered "open" after ring buffers are successfuly registered. */ + if (!wintun_register_ring_buffer(tt)) + { + msg(D_TUNTAP_INFO, "Failed to register %s adapter ring buffers", device_guid); + return false; + } + } + + return true; +} + static void tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_guid) { struct gc_arena gc = gc_new(); - char *path = NULL; char tuntap_device_path[256]; const struct tap_reg* tap_reg = get_tap_reg(&gc); const struct panel_reg* panel_reg = get_panel_reg(&gc); @@ -6197,27 +6257,11 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui if (tt->wintun) { - const struct device_instance_id_interface* dev_if; - if (!is_picked_device_wintun) { /* wintun driver specified but picked adapter is not wintun, proceed to next one */ goto next; } - - path = NULL; - for (dev_if = device_instance_id_interface; dev_if != NULL; dev_if = dev_if->next) - { - if (strcmp(dev_if->net_cfg_instance_id, *device_guid) == 0) - { - path = (char*)dev_if->device_interface_list; - break; - } - } - if (path == NULL) - { - goto next; - } } else { @@ -6226,28 +6270,9 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui /* tap-windows6 driver specified but picked adapter is wintun, proceed to next one */ goto next; } - - /* Open Windows TAP-Windows adapter */ - openvpn_snprintf(tuntap_device_path, sizeof(tuntap_device_path), "%s%s%s", - USERMODEDEVICEDIR, - *device_guid, - TAP_WIN_SUFFIX); - path = tuntap_device_path; } - tt->hand = CreateFile(path, - GENERIC_READ | GENERIC_WRITE, - 0, /* was: FILE_SHARE_READ */ - 0, - OPEN_EXISTING, - FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, - 0); - - if (tt->hand == INVALID_HANDLE_VALUE) - { - msg(D_TUNTAP_INFO, "CreateFile failed on %s device: %s", tt->wintun ? "wintun" : "TAP", tuntap_device_path); - } - else + if (tun_try_open_device(tt, *device_guid, device_instance_id_interface)) { break; } @@ -6261,7 +6286,7 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui * GUID using the registry */ tt->actual_name = string_alloc(actual_buffer, NULL); - msg(M_INFO, "%s device [%s] opened: %s", tt->wintun ? "Wintun" : "TAP-WIN32", tt->actual_name, path); + msg(M_INFO, "%s device [%s] opened", tt->wintun ? "Wintun" : "TAP-WIN32", tt->actual_name); tt->adapter_index = get_adapter_index(*device_guid); gc_free(&gc); @@ -6372,14 +6397,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun tun_open_device(tt, dev_node, &device_guid); - if (tt->wintun) - { - if (!wintun_register_ring_buffer(tt)) - { - msg(M_FATAL, "Failed to register ring buffers"); - } - } - else + if (!tt->wintun) { tuntap_post_open(tt, device_guid); } From patchwork Thu Dec 19 11:39:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 947 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id cPjKIXH8+13nUQAAIUCqbw for ; Thu, 19 Dec 2019 17:40:49 -0500 Received: from proxy19.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id UATOHnH8+13ZFQAApN4f7A ; Thu, 19 Dec 2019 17:40:49 -0500 Received: from smtp24.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.iad3b.rsapps.net with LMTP id mJ0bGHH8+13hVgAAIG4riQ ; Thu, 19 Dec 2019 17:40:49 -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: smtp24.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 99f1042a-22b0-11ea-8724-525400892b35-1-1 Received: from [216.105.38.7] ([216.105.38.7:42292] helo=lists.sourceforge.net) by smtp24.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 17/A9-17584-07CFBFD5; Thu, 19 Dec 2019 17:40:48 -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.90_1) (envelope-from ) id 1ii4Sg-0001Lp-De; Thu, 19 Dec 2019 22:40:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4SX-0001Kv-Mz for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:54 +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=C+Ffh93Hou48gBRf45acisYqKcYGN/gf+Cd6mDj44Lw=; b=NYEYsf8rJnhhdFiXeJ8JiILWQ5 lrFhOsUc1+Ewe4cRSQJp5cp6oScqR9k35KljRcjIQU8N6spY3srA+yxv1X24vzDshgH+w3wEkCIxQ dxDYywB8KxCTo5KRQ1Weza/b/K6aW3vKz31j3SUms+a3OHkm9BwaP8ciSRwFt84bQm6c=; 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=C+Ffh93Hou48gBRf45acisYqKcYGN/gf+Cd6mDj44Lw=; b=FYpInAfhWHGI34Lzv5a35PUKlx Eje07ikmBF+FQhRr6dyNISt3NF5UlX6smGeho6JWrZZboM6AzbLo1raRKdgOZ31jWD3LZ/2zKDK9b dpbFQYl2DAPtdRSj4kCSE6rFFriA8iAXs9Qbv6HMh9vRfETNeIXPK5+Fcs5Z7t+txwrI=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4ST-007tdt-3h for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:51 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id D2F281002FBD; Thu, 19 Dec 2019 23:39:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795178; bh=C+Ffh93Hou48gBRf45acisYqKcYGN/gf+Cd6mDj44Lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kI9CPRdr8zbUIDrX8A20+vN/7U9DrivFX/Z/9EaQHsZtp5/kq7zof7l1edbu0GYWI xWlDnl5ATUajK3g+b04yEn0TVF9oBb70GvPgGMZ4ECm+DsjFzvw2JpaYGRHIhaFjPg cyoNEYWEmczuDHbiazNDLrsVjcVbKwBElmC6lpxg= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id 005871004495; Thu, 19 Dec 2019 23:39:31 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:15 +0100 Message-Id: <20191219223917.1614-5-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4ST-007tdt-3h Subject: [Openvpn-devel] [PATCH 5/7] wintun: add support for --dev-node 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 Signed-off-by: Simon Rozman Acked-by: Lev Stipakov --- src/openvpn/tun.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 9dc9b3a2..8508b9c0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6194,7 +6194,6 @@ static void tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_guid) { struct gc_arena gc = gc_new(); - char tuntap_device_path[256]; const struct tap_reg* tap_reg = get_tap_reg(&gc); const struct panel_reg* panel_reg = get_panel_reg(&gc); const struct device_instance_id_interface* device_instance_id_interface = get_device_instance_id_interface(&gc); @@ -6207,31 +6206,34 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui */ if (dev_node) { + bool is_picked_device_wintun = false; + /* Get the device GUID for the device specified with --dev-node. */ - *device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), NULL, tap_reg, panel_reg, &gc); + *device_guid = get_device_guid(dev_node, actual_buffer, sizeof(actual_buffer), &is_picked_device_wintun, tap_reg, panel_reg, &gc); if (!*device_guid) { - msg(M_FATAL, "TAP-Windows adapter '%s' not found", dev_node); + msg(M_FATAL, "Adapter '%s' not found", dev_node); } - /* Open Windows TAP-Windows adapter */ - openvpn_snprintf(tuntap_device_path, sizeof(tuntap_device_path), "%s%s%s", - USERMODEDEVICEDIR, - *device_guid, - TAP_WIN_SUFFIX); - - tt->hand = CreateFile(tuntap_device_path, - GENERIC_READ | GENERIC_WRITE, - 0, /* was: FILE_SHARE_READ */ - 0, - OPEN_EXISTING, - FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, - 0); + if (tt->wintun) + { + if (!is_picked_device_wintun) + { + msg(M_FATAL, "Adapter '%s' is TAP-Windows, Wintun expected", dev_node); + } + } + else + { + if (is_picked_device_wintun) + { + msg(M_FATAL, "Adapter '%s' is Wintun, TAP-Windows expected", dev_node); + } + } - if (tt->hand == INVALID_HANDLE_VALUE) + if (!tun_try_open_device(tt, *device_guid, device_instance_id_interface)) { - msg(M_ERR, "CreateFile failed on TAP device: %s", tuntap_device_path); + msg(M_FATAL, "Failed to open %s adapter: %s", tt->wintun ? "Wintun" : "TAP-Windows", dev_node); } } else From patchwork Thu Dec 19 11:39:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 953 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id UJz9C3/8+10lLgAAIUCqbw for ; Thu, 19 Dec 2019 17:41:03 -0500 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id 0E1lCX/8+13wTgAAovjBpQ ; Thu, 19 Dec 2019 17:41:03 -0500 Received: from smtp30.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTP id MGGYA3/8+12ALQAAhyf7VQ ; Thu, 19 Dec 2019 17:41:03 -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: smtp30.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: a25fceca-22b0-11ea-90f2-525400502618-1-1 Received: from [216.105.38.7] ([216.105.38.7:42380] helo=lists.sourceforge.net) by smtp30.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 6D/7E-03371-E7CFBFD5; Thu, 19 Dec 2019 17:41:02 -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.90_1) (envelope-from ) id 1ii4Sm-0001N9-SI; Thu, 19 Dec 2019 22:40:08 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4Sl-0001Me-4E for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:40:07 +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=B+8Ec2AByDqlnz57QFyHVY5LSvK5694O8qMos1Nling=; b=M1+DaHTqSnVYh4WCOMxDBi0g0a VRWhRiCsjZacJEFtCP9aPSEokgNjHcL2UhH4UybeP8iH8rz3lafnSztqqkSfu6nrYZYDvIKrUDrME 2apXWNUKlzxg9tJxeWXR8cxa3DWwnlNBT6SMxBS/Pu80l+N1sY507+ikruZw/ZPQOOII=; 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=B+8Ec2AByDqlnz57QFyHVY5LSvK5694O8qMos1Nling=; b=jv+IkOYDkHcDOmQ87ixH32uPPr z7hsFIy0Ii4M7w6ZPlpOsE0qE/iPEoPbIdbY9g7RZVuTtNjhnnkYTuEpFXVd7W9DyTjdWaPPigdOM w2y3W46Ff9XpiiMyljhmAxTjjI0PkIwMsMqGQ/sekkjcbgkYk2oQ9EXJV5xg+A7esKBs=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4Si-00AYZP-KQ for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:40:07 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 275531002FBC; Thu, 19 Dec 2019 23:39:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795180; bh=B+8Ec2AByDqlnz57QFyHVY5LSvK5694O8qMos1Nling=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Odsa14gBdTlfw98OZ3e5PUufqxEwqyXufPqK8hNDq2RL2/Pq4phyTVnn3sHXHSUV2 auaLYyEfaX3ZrvEtpLtSIKtl4o0eKxMkQ3TIeaJ5o9wsNRqvMQFelKhAF+dOM0fXZO 7Ug1kJOM8eIYfgj1GHAIDirIYzF+nWlBOaBCajAo= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id 0ED6C1004498; Thu, 19 Dec 2019 23:39:31 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:16 +0100 Message-Id: <20191219223917.1614-6-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4Si-00AYZP-KQ Subject: [Openvpn-devel] [PATCH 6/7] wintun: stop sending TAP-Windows6 ioctls to NDIS device 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 Wintun doesn't have its own I/O device. Rather, it taps on existing Windows-provided NDIS device. Sending TAP-Windows6 IOCTL requests to it is risky, as TAP-Windows6 is using one of the well-known device types (FILE_DEVICE_UNKNOWN) with function IDs as 1, 2, 3 etc. raising a chance of collision as NDIS might react to one of these IOCTLs. Signed-off-by: Simon Rozman --- src/openvpn/error.c | 5 ++++- src/openvpn/forward.c | 2 +- src/openvpn/sig.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openvpn/error.c b/src/openvpn/error.c index b2492f2b..8d91a131 100644 --- a/src/openvpn/error.c +++ b/src/openvpn/error.c @@ -688,7 +688,10 @@ x_check_status(int status, } #elif defined(_WIN32) /* get possible driver error from TAP-Windows driver */ - extended_msg = tap_win_getinfo(tt, &gc); + if (!tt->wintun) + { + extended_msg = tap_win_getinfo(tt, &gc); + } #endif if (!ignore_sys_error(my_errno)) { diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 6b823613..2bc9d871 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1956,7 +1956,7 @@ pre_select(struct context *c) if (check_debug_level(D_TAP_WIN_DEBUG)) { c->c2.timeval.tv_sec = 1; - if (tuntap_defined(c->c1.tuntap)) + if (tuntap_defined(c->c1.tuntap) && !c->c1.tuntap->wintun) { tun_show_debug(c->c1.tuntap); } diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c index d7f2abb8..f02aa57c 100644 --- a/src/openvpn/sig.c +++ b/src/openvpn/sig.c @@ -315,7 +315,7 @@ print_status(const struct context *c, struct status_output *so) status_printf(so, "Post-decrypt truncations," counter_format, c->c2.n_trunc_post_decrypt); #endif #ifdef _WIN32 - if (tuntap_defined(c->c1.tuntap)) + if (tuntap_defined(c->c1.tuntap) && !c->c1.tuntap->wintun) { status_printf(so, "TAP-WIN32 driver status,\"%s\"", tap_win_getinfo(c->c1.tuntap, &gc)); From patchwork Thu Dec 19 11:39:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 951 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id kHNLAXv8+12ODQAAIUCqbw for ; Thu, 19 Dec 2019 17:40:59 -0500 Received: from proxy11.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id kARAOnr8+10XUAAAovjBpQ ; Thu, 19 Dec 2019 17:40:59 -0500 Received: from smtp9.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3b.rsapps.net with LMTP id cBoANHr8+13BTgAARNREpw ; Thu, 19 Dec 2019 17:40:58 -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: smtp9.gate.iad3b.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; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 9fec88cc-22b0-11ea-82ad-525400f4d366-1-1 Received: from [216.105.38.7] ([216.105.38.7:52338] helo=lists.sourceforge.net) by smtp9.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E0/51-29691-A7CFBFD5; Thu, 19 Dec 2019 17:40:58 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ii4Sg-00068l-JB; Thu, 19 Dec 2019 22:40:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ii4Sd-000685-9I for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:59 +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=rff7A6XJxLBrJV8gRfkdjd7yNa5dnT4nubAdT7rqO6c=; b=JhKIY+a9wJwIO92XLc91eDueyM S3NH+VAg/ZSvgkHNMeoEWF8OYpT/+ihKAl+YerLi4cq1lcEo51Jv7PHucHJL0ls4g5dXYp14MUbGt yu4na6syulG4TX/SLCQmwEu4gxEnl9p3T+NXLFipn5LPui531WRAxqjwR1W0eOF+/lcs=; 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=rff7A6XJxLBrJV8gRfkdjd7yNa5dnT4nubAdT7rqO6c=; b=BG8M3TxdptSNw19e299jUZwqsY /oDOmVMf3M7nOtQk/FKpkU0o3RBc6D57FXQlDKL7WcwydY6A2JFfUcmMK1RpMg2M00dyTK2u6hu7+ ot2rZvZbMnNc0j4Z7jacmZTo6exBW7p6/XNPE+37qTrt72tJv+gysjSRT05WDpZqR7S0=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ii4Sc-00AO1y-2n for openvpn-devel@lists.sourceforge.net; Thu, 19 Dec 2019 22:39:59 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 0DAF71004495; Thu, 19 Dec 2019 23:39:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576795179; bh=rff7A6XJxLBrJV8gRfkdjd7yNa5dnT4nubAdT7rqO6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jECALdhrQzKjcCWIveMaitQK+z2yScqM92d+viFPCTkAan2R3yl+t519c7KKSbsbA 6u3zX7+U0YG3lJa1JcKNZP3YcptOAUcJ8jkLXMwhQPF/JtOu/IPpzVBZrl3C1+DaZp jQRJyfhbOOv/iPd7LacWrE1ddK63cH/sUkjrHvQs= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:99ff:8a54:cadf:8a38]) by pub5.amebis.si (Postfix) with ESMTP id 1E04C1004499; Thu, 19 Dec 2019 23:39:31 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Thu, 19 Dec 2019 23:39:17 +0100 Message-Id: <20191219223917.1614-7-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20191219223917.1614-1-simon@rozman.si> References: <20191219223917.1614-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ii4Sc-00AO1y-2n Subject: [Openvpn-devel] [PATCH 7/7] tun.c: reword the at_least_one_tap_win() error 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 Signed-off-by: Simon Rozman Acked-by: Lev Stipakov --- src/openvpn/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 8508b9c0..14ff0259 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -4031,7 +4031,7 @@ at_least_one_tap_win(const struct tap_reg *tap_reg) { if (!tap_reg) { - msg(M_FATAL, "There are no TAP-Windows adapters on this system. You should be able to create a TAP-Windows adapter by going to Start -> All Programs -> TAP-Windows -> Utilities -> Add a new TAP-Windows virtual ethernet adapter."); + msg(M_FATAL, "There are no TAP-Windows nor Wintun adapters on this system. You should be able to create an adapter by using tapctl.exe utility."); } }