From patchwork Fri Dec 20 05:11: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: 959 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 +NGkIn/z/F1jAwAAIUCqbw for ; Fri, 20 Dec 2019 11:14:55 -0500 Received: from proxy1.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id 8Fj7H3/z/F3SJgAApN4f7A ; Fri, 20 Dec 2019 11:14:55 -0500 Received: from smtp28.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.iad3b.rsapps.net with LMTP id wOHLGX/z/F1+PgAALM5PBw ; Fri, 20 Dec 2019 11:14:55 -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: smtp28.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: db7d37ae-2343-11ea-9a1b-525400c8cd63-1-1 Received: from [216.105.38.7] ([216.105.38.7:51142] helo=lists.sourceforge.net) by smtp28.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id D4/CC-16807-E73FCFD5; Fri, 20 Dec 2019 11:14:54 -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 1iiKue-0006yt-HS; Fri, 20 Dec 2019 16:14:00 +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 1iiKuX-0006yU-92 for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13: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=P6ycstvdVemZcctDGqIOTVFUyIcysImLussSnZ7zzMo=; b=jFxM19cIFg63UrDvxjEP8YdvdC VWuqXZIszmqjOiWeO1rGsRgpjgxN2Hh4RWZ0McLzRTtlMnKIHfPKHuylrup9nFuRhuFJNNz1ACrOK WNS3B4CfgYgENqE4Wcg/8joWgl7hLgC83Z4rOBV3I8vHXXdd/JA0Ke5yL+WkimOeLNcg=; 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=P6ycstvdVemZcctDGqIOTVFUyIcysImLussSnZ7zzMo=; b=dwAqUSZ/9VPZUkmwQfGpQxN6xH F5/lKelP06jGuD6ZRPICN4vkEB2PxIPqDD6/AZp/V5Z/d0uagRdMCyPDD7yTX7KUuoCVFnXiN5UHO iJFWEDdKvlLK8KcDkhvriJ9V41zSC/rQGRZZfSu0poSeLsdcm4QvIDp9eEfDn3LXZRPM=; 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 1iiKuV-00BKmF-6h for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 9991E1004498; Fri, 20 Dec 2019 17:13:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858415; bh=P6ycstvdVemZcctDGqIOTVFUyIcysImLussSnZ7zzMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bg3VQ+L5vRNT6X4h6TLjWCIaxVI4j5vIW/jpy40ojrTWmt4gyit8RJ4IrO8jbfCYv x5zHlVZojzjDWE7HrgXWEECG9FFXdww2hskERKuTphsSmUh/lzXE3wdnNXJTgilsJJ fHCXoA0C0uCRQ/SBrdu3t5qDFmWltBOZImr9X8fg= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 3E72C1002FB9; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:11 +0100 Message-Id: <20191220161117.1434-1-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKuV-00BKmF-6h Subject: [Openvpn-devel] [PATCH v2 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..0d6f40fe 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_adapter_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_adapter_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_adapter_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_adapter_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_adapter_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_adapter_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 Fri Dec 20 05:11: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: 958 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 mG6GBH/z/F3QBwAAIUCqbw for ; Fri, 20 Dec 2019 11:14:55 -0500 Received: from proxy6.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id wOHeAX/z/F2uIwAAIasKDg ; Fri, 20 Dec 2019 11:14:55 -0500 Received: from smtp30.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.iad3b.rsapps.net with LMTP id UORmN37z/F24JgAARawThA ; Fri, 20 Dec 2019 11:14:54 -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: dabf8434-2343-11ea-90f2-525400502618-1-1 Received: from [216.105.38.7] ([216.105.38.7:42594] 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 40/8E-03371-D73FCFD5; Fri, 20 Dec 2019 11:14:53 -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 1iiKuY-0003sN-Bg; Fri, 20 Dec 2019 16:13:54 +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 1iiKuX-0003s6-AV for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13: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=vTI1UlCzhNdz8hxZ8DzlVC6J9b794Yrcs/oCNuaJ7C0=; b=Y0Z/MKMdZ92SsUVBCUVMOCdu1b MljmiGjBqGEOtX706mZ+QxSAVP+bRrvfUXPn7lsyJxVgP+nBgwoZ5x7zonkaVnmlImhh/3NArL/iZ pkvg7Elvn36snumvUmQtmg/DOpOixaSTsiDSiKVWfu5pA3hBXsuiAPTLbocCVpzMjq3U=; 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=vTI1UlCzhNdz8hxZ8DzlVC6J9b794Yrcs/oCNuaJ7C0=; b=UPXUy2LEEb96qdVRbvWK83PnQo Gql9i4rdv8+sUy5SU1sL327FUwH8e7g2VqR5LguPEElR2UBy3QEZxzgj27PZbcay942JM69ObtG/a efYW9wy0aZvJOOo7wsJLbCbOZyb5khqq4ZRxOFO4LD4A6lrU/H/nbzEMkXQanLSzKFuI=; 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 1iiKuU-00BCAc-So for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id D24D61002FB9; Fri, 20 Dec 2019 17:13:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858417; bh=vTI1UlCzhNdz8hxZ8DzlVC6J9b794Yrcs/oCNuaJ7C0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iaal4xNVll9UrU3QpE6/dTvg44q893HPdV+vbngOZmN6qP/037m0rHvZs308bTM2Y p8+5aapaqbNkieOnPGoFUnjblC5YZgo2xst9/Pj1Kp20xJOBwc/b9ff4nBeb1EyMyZ vQPKyffELDYghEDqnAS6nFN8i5ZqTKWOedbMyhic= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 4F85D1002FBA; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:12 +0100 Message-Id: <20191220161117.1434-2-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKuU-00BCAc-So Subject: [Openvpn-devel] [PATCH v2 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 0d6f40fe..f90f201d 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -4104,12 +4104,13 @@ get_unspecified_device_guid(const int device_number, /* * Lookup a --dev-node adapter name in the registry - * returning the GUID and optional actual_name. + * returning the GUID and optional actual_name and device type */ 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 Fri Dec 20 05:11: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: 954 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id QEP+KHPz/F2VIgAAIUCqbw for ; Fri, 20 Dec 2019 11:14:43 -0500 Received: from proxy5.mail.iad3b.rsapps.net ([172.31.255.6]) by director11.mail.ord1d.rsapps.net with LMTP id SOrtJXPz/F3CIAAAvGGmqA ; Fri, 20 Dec 2019 11:14:43 -0500 Received: from smtp14.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.iad3b.rsapps.net with LMTP id IJA1H3Pz/F2zJgAA13hMnw ; Fri, 20 Dec 2019 11:14:43 -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: smtp14.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: d4648760-2343-11ea-973e-52540057873d-1-1 Received: from [216.105.38.7] ([216.105.38.7:59260] helo=lists.sourceforge.net) by smtp14.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id B0/B2-18066-273FCFD5; Fri, 20 Dec 2019 11:14:42 -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 1iiKuZ-0002pO-DE; Fri, 20 Dec 2019 16:13:55 +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 1iiKuX-0002p0-63 for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13: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=r8b+99HY+jgT166IC/lf921MzuJywDB2s4Zdx3atWPA=; b=m9FNdoGocLmqn6K1rbIjZzJLwR T6CiaM8DOdDGslp41YFO6yvV96g5DLoGTkwRTAHZBqxNWG+fw6/T4tp2/y5YTK5zDdeOO8OEEkbE6 J3xLO5svUhYgsBq9lirLsNAV1kbBUxWEJHscrRl3Lu6kmDpgpFr3XVzT8I09h66SJ6ZM=; 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=r8b+99HY+jgT166IC/lf921MzuJywDB2s4Zdx3atWPA=; b=J5yofQJjUeDKkPX14C47xk9ySz 4VxENCX94/PHDyiJXT6qXNfHBrzP9mwT0cSvkbYVwp3NIVO6+yYwujBrh5GW0JqqPZPU7mRG+psgU l8iV0TqcQEAOLd65He/W4IjiceF+4za+zpWJw9FAcSyFJ2cVdQBL4LzV6wvZAqdQzG4Q=; 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 1iiKuV-00BKmO-6f for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id DEA4F1002FBA; Fri, 20 Dec 2019 17:13:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858417; bh=r8b+99HY+jgT166IC/lf921MzuJywDB2s4Zdx3atWPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=moKh4gqYc7qS6g4OwYCWNgnUv3h29w5zngwvrtuHy0VT12/RjxKqdwvfIxFwaQpGu TmQnKy5JEwx0DahteywBRgsl2zgyc0cK9232/wYH/bRnHanmakW64hLAcTdlKA8zVr b7DDH5LSC4a8X/bwoSZMiS3/50OxThmCk5S0U4BI= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 5E5821002FBB; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:13 +0100 Message-Id: <20191220161117.1434-3-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKuV-00BKmO-6f Subject: [Openvpn-devel] [PATCH v2 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 f90f201d..c6bbbd41 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 Fri Dec 20 05:11: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: 955 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 CBQoAnTz/F1hOAAAIUCqbw for ; Fri, 20 Dec 2019 11:14:44 -0500 Received: from proxy2.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id SFkZO3Pz/F1XJwAApN4f7A ; Fri, 20 Dec 2019 11:14:44 -0500 Received: from smtp16.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.iad3b.rsapps.net with LMTP id IIfxNHPz/F1gbwAAvAZTew ; Fri, 20 Dec 2019 11:14:43 -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: smtp16.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: d4a66874-2343-11ea-a658-5254004ed364-1-1 Received: from [216.105.38.7] ([216.105.38.7:59272] helo=lists.sourceforge.net) by smtp16.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 91/E3-22989-373FCFD5; Fri, 20 Dec 2019 11:14:43 -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 1iiKub-0002pp-LT; Fri, 20 Dec 2019 16:13:57 +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 1iiKuX-0002pC-D7 for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13: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=2xpPOnY+A0bcgCJoZFg7KDo+XLNoFxhRoZOs5TuK6ZM=; b=I7TLaJbyavHrf52PhO1Tg8JRQU PQYKM8vP7vCd5bM3mF1RI8h1fU5cMBfrqvd2Tj6dvEY9VC+mAP8WreRvTmbKuLK2lMOdq8zLTWY0E qZ18u9YlPzzC0g2f69vfm8KIFK8bvD40ulv9ytMflBSn0YYkx+A2/J6W6WHi80cM72KI=; 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=2xpPOnY+A0bcgCJoZFg7KDo+XLNoFxhRoZOs5TuK6ZM=; b=kosssZDG8vEDMQrYgqSccEd32n wslBaFsLhOJO8Dl39PFR3hevzaGSvEbAoOzEq0KWhyHnxLSgyLVDny6+A64Zhs0yA8KQoY5OWwh/m Gq88MAj1QrCOwPWy1NKZ95ImVTPu8Q5FFi9VuoSV9AKVIZXlA5Yq7pPfKeWgxBUNoU6g=; 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 1iiKuU-00BCAf-ST for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 124861002FBB; Fri, 20 Dec 2019 17:13:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858419; bh=2xpPOnY+A0bcgCJoZFg7KDo+XLNoFxhRoZOs5TuK6ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYchN3saIfen3mnIYk9Mflvj8Z6aWHJ0zBVym0MjruQeXhYAgVe8WsxpuJH+vGGYm zBQkozPsZK/YybPAJ66K7OZbmaljXqiIWYi4arfzQFvkgUHzZ4Jbxkx23ajyIS9G3I JUwKL/5rX+vkM3nwHB0VmQWl/scUzlABGQ2NayCw= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 6C6691002FBC; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:14 +0100 Message-Id: <20191220161117.1434-4-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKuU-00BCAf-ST Subject: [Openvpn-devel] [PATCH v2 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 | 112 +++++++++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 46 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index c6bbbd41..f56682ef 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6129,11 +6129,73 @@ 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]; + HANDLE h; + + 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; + } + + h = CreateFile(path, + GENERIC_READ | GENERIC_WRITE, + 0, /* was: FILE_SHARE_READ */ + 0, + OPEN_EXISTING, + FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, + 0); + if (h == 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); + CloseHandle(h); + return false; + } + } + + tt->hand = h; + 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 +6259,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 +6272,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 +6288,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 +6399,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 Fri Dec 20 05:11: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: 956 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id uMFLJnfz/F1hOAAAIUCqbw for ; Fri, 20 Dec 2019 11:14:47 -0500 Received: from proxy10.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id 6EoxI3fz/F1qJwAAalYnBA ; Fri, 20 Dec 2019 11:14:47 -0500 Received: from smtp28.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3b.rsapps.net with LMTP id QGBcHHfz/F1FAwAA/F5p9A ; Fri, 20 Dec 2019 11:14:47 -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: smtp28.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: d6ee21da-2343-11ea-9a1b-525400c8cd63-1-1 Received: from [216.105.38.7] ([216.105.38.7:59322] helo=lists.sourceforge.net) by smtp28.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F4/BC-16807-673FCFD5; Fri, 20 Dec 2019 11:14:47 -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 1iiKuZ-0002pY-IW; Fri, 20 Dec 2019 16:13:55 +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 1iiKuX-0002p6-BW for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13: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=vQV9FlihCLONdv5dpvIJuR1bYBcaplxc+kJd74x4Whs=; b=VwNvTb3qP9W7RUfoZs/pcXLDUU MhE9l2YViFbAL26Nc2XU0Op06+3Gk90MHPFTY0AQsJKzswmi2tGlFy8TH/kfzluFaal0tIqubKPF/ so2SAENfIZ/KxczOh4NdTkUN2fIfElvqDja0Xnl80bswjhbaLvFH1Kl2mmApOkv3Lv94=; 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=vQV9FlihCLONdv5dpvIJuR1bYBcaplxc+kJd74x4Whs=; b=fUlIlfXWP4aPJ4TGxepfwL79KR ThcWMiaDggUoBoxnr9swlvxCcwNrMUfFvVzE5C9/xJJkdV9moCU9IL7T3cw52jZxOlYlj/3DfVQD4 vNhoHNMjstphouzna6jGkx2w0pSXl/LQv5vPZbBsXTgXCvWdSpIOnAkqZMG/FvVTJ7T8=; 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 1iiKuV-00BKmS-7K for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:13:53 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 1D2221004499; Fri, 20 Dec 2019 17:13:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858420; bh=vQV9FlihCLONdv5dpvIJuR1bYBcaplxc+kJd74x4Whs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Atv41uWITFNg+4ISN04Xq3faZ0DU6Kvc/hjCtssgm9CpKZXXb38b3WfaGUgNOmCph 6fQq9x/VMQXek1Nm64UEUKHSxbx9lZe7RczcymUgbLQj6UTWZb4dBmSTfkFto0nmOg ywZbbY65vKA5UMMMmZ8OGVXlASqQZvkK3UUeuo/I= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 7A66B1002FBD; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:15 +0100 Message-Id: <20191220161117.1434-5-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKuV-00BKmS-7K Subject: [Openvpn-devel] [PATCH v2 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 f56682ef..18f06bb6 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6196,7 +6196,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); @@ -6209,31 +6208,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. If you want to use this device, remove --windows-driver wintun.", dev_node); + } + } + else + { + if (is_picked_device_wintun) + { + msg(M_FATAL, "Adapter '%s' is Wintun, TAP-Windows expected. If you want to use this device, add --windows-driver wintun.", 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 Fri Dec 20 05:11: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: 960 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 oF6/GYDz/F1hOAAAIUCqbw for ; Fri, 20 Dec 2019 11:14:56 -0500 Received: from proxy20.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id aKd0F4Dz/F3KZAAAovjBpQ ; Fri, 20 Dec 2019 11:14:56 -0500 Received: from smtp36.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy20.mail.iad3b.rsapps.net with LMTP id GLJGEoDz/F0IMAAAcDxLoQ ; Fri, 20 Dec 2019 11:14:56 -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: smtp36.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: dbe8980a-2343-11ea-a61b-5254003a7283-1-1 Received: from [216.105.38.7] ([216.105.38.7:51150] helo=lists.sourceforge.net) by smtp36.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E0/DD-26583-F73FCFD5; Fri, 20 Dec 2019 11:14:55 -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 1iiKug-0006zW-MI; Fri, 20 Dec 2019 16:14: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 1iiKuf-0006z8-3i for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:14:01 +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=J2sFs+P82kpwS2vvb5EY4Zls6UjKsyJA1Nbv7ZPLMyM=; b=F3EekCXfIPjNt/iHiJkxPJ6CGz Zo1VwCusvxFFHD0Q6bBWh/Y1Kb+p/6nKppAFZIe35RzG+m9PTDU8qwaaor+4LpZhRsh+GJoqlAbcH oaYjFxhR5NgOXXY2z3pN3JQXgO5rTB2Tb4UTzZgvmHkqTyd7ixJtjbDtjiyMytvXoQY8=; 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=J2sFs+P82kpwS2vvb5EY4Zls6UjKsyJA1Nbv7ZPLMyM=; b=FqwuJsLyO9IAqhE4kLFiR5rVQd 5dV6fXSf4VMpLbpj6OzaghLhl1g84IwIZyl9S4rezx33t1gUttYKUUKpGsDNnvLGfIwUim1B2b4Gm XbN7EY8W90FfxKdYjkujqj28VqPeK4b4F1Ao9a2lRbfITz9GV7X+fCv5lEjPVTu2JAps=; 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 1iiKud-00BKnG-Sd for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:14:01 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id DAFE51002FBC; Fri, 20 Dec 2019 17:13:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858420; bh=J2sFs+P82kpwS2vvb5EY4Zls6UjKsyJA1Nbv7ZPLMyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjumDd6+7D/nYWmhL9WVCfSN91ypoy9zxpxN//Qs3QrpJO5rGxfW+UM3Vx7qGmzvM uQVghfnhoGINZh9hbo1pvA2ZBDJC2fyh65NDYWajUM6IGRU9JhWdC1LJK5e5wT51h4 NqE8iTyAzARMB3myHwUfNtQXeAMND5B6/P9EWiN0= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 8963D1004495; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:16 +0100 Message-Id: <20191220161117.1434-6-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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: 1iiKud-00BKnG-Sd Subject: [Openvpn-devel] [PATCH v2 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/tun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 18f06bb6..6762402c 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6412,7 +6412,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun const char * tap_win_getinfo(const struct tuntap *tt, struct gc_arena *gc) { - if (tt && tt->hand != NULL) + if (tuntap_defined(tt) && !tt->wintun) { struct buffer out = alloc_buf_gc(256, gc); DWORD len; @@ -6430,7 +6430,7 @@ tap_win_getinfo(const struct tuntap *tt, struct gc_arena *gc) void tun_show_debug(struct tuntap *tt) { - if (tt && tt->hand != NULL) + if (tuntap_defined(tt) && !tt->wintun) { struct buffer out = alloc_buf(1024); DWORD len; From patchwork Fri Dec 20 05:11: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: 957 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 wD0XBH7z/F1jAwAAIUCqbw for ; Fri, 20 Dec 2019 11:14:54 -0500 Received: from proxy12.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id MCjyAH7z/F1nJwAApN4f7A ; Fri, 20 Dec 2019 11:14:54 -0500 Received: from smtp8.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.iad3b.rsapps.net with LMTP id GGe5NX3z/F0WZAAAEsW3lA ; Fri, 20 Dec 2019 11:14:53 -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: smtp8.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: dac55666-2343-11ea-9681-5254005eee35-1-1 Received: from [216.105.38.7] ([216.105.38.7:51130] helo=lists.sourceforge.net) by smtp8.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id B7/8B-31440-D73FCFD5; Fri, 20 Dec 2019 11:14:53 -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 1iiKuq-00070w-TD; Fri, 20 Dec 2019 16:14:12 +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 1iiKuo-00070j-Un for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:14:10 +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=1WtbJTj8cOrGDjKa8FOXL6C+7E5aBw1egjDUZT+f7v4=; b=TFsClFQeGyyON42b7KkQh/cQed H4z+V66C7N7SFZ3NRoQE+bnAxh9Pqq7HIWiOcP4/+koXtWfNxEOPaMy4cCPs+uFYbfELjXiA03L+t jeucMBLWCtbnEZYohITmypMWQc2znT8Hc4AxRo/z5T5CzObo4waHzDMg3CJ1MSn5b+nA=; 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=1WtbJTj8cOrGDjKa8FOXL6C+7E5aBw1egjDUZT+f7v4=; b=S6NcyICaLcLk1eZ6M585L93I0l cjKskOy5KeCNVjuFTeAwd/KSMI71vEE79lHVQB6vj499NkAzbHwA731J+GZLREybEUmJMYTra9dEd fFNu49Kfur9DCgfRMi2NPVz8QqtZUorafuhkJqiLbPXMv8H4PxObYYsvor6+hWHIoBPg=; 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 1iiKuk-008tmK-Q5 for openvpn-devel@lists.sourceforge.net; Fri, 20 Dec 2019 16:14:10 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 3737B1002FBD; Fri, 20 Dec 2019 17:13:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1576858421; bh=1WtbJTj8cOrGDjKa8FOXL6C+7E5aBw1egjDUZT+f7v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cngAAId1VoQgJX/pQHj3OvGYt5R7Xij6e32dATzyUIk45L28KjH0l/NzqXs5kKlwZ U5m/LZ1Ba+GTVdEa4wVOzf/MPcX1nZSaPxV/iKFl1L9u+g80p8MOuzrnuuPePRUj7O y5JVIBiaRWmlg6WM3cU4yYQRuwVVEHL/D7YJfmRc= 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, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a050:acdc:f245:eef3]) by pub5.amebis.si (Postfix) with ESMTP id 978A11004496; Fri, 20 Dec 2019 17:13:33 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Fri, 20 Dec 2019 17:11:17 +0100 Message-Id: <20191220161117.1434-7-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: References: 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.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1iiKuk-008tmK-Q5 Subject: [Openvpn-devel] [PATCH v2 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 6762402c..4e16f989 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."); } }