| Message ID | 20181016102627.18676-5-simon@rozman.si |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> 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 YOcTMSi9xVu1eAAAIUCqbw for <patchwork@openvpn.net>; Tue, 16 Oct 2018 06:27:52 -0400 Received: from proxy7.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id mNOILii9xVucbQAAalYnBA ; Tue, 16 Oct 2018 06:27:52 -0400 Received: from smtp33.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.iad3b.rsapps.net with LMTP id sC+dKCi9xVsaDQAAQkQ5tQ ; Tue, 16 Oct 2018 06:27:52 -0400 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: smtp33.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: 22d2e888-d12e-11e8-a925-525400fb5834-1-1 Received: from [216.105.38.7] ([216.105.38.7:48204] helo=lists.sourceforge.net) by smtp33.gate.iad3b.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AC/7D-30416-82DB5CB5; Tue, 16 Oct 2018 06:27:52 -0400 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 <openvpn-devel-bounces@lists.sourceforge.net>) id 1gCMYq-0006qa-Mq; Tue, 16 Oct 2018 10:26:48 +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 <simon@rozman.si>) id 1gCMYp-0006q9-11 for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:47 +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=20M64mkV04otVaJko6LpE/NzJM0AFoXnn4q+Jf3+GDs=; b=glKY9M0+y99RH98HLQkpejJyEk SWglzYwraFdRVmyvrruSXpB/FkVO/SUs8TeKP2o8H8OJ1yrxA4nQ4lw8XoGJ2yMgIUhGFg9bdS7aC 1oh+8FAmoK8WlXIjlOH+pINt0PFrkPPdt/Z1ixvAMHH0wmnolQhKtnF0OOzYA1shkvG4=; 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=20M64mkV04otVaJko6LpE/NzJM0AFoXnn4q+Jf3+GDs=; b=UviUwFMquHSpgpPOxSxHc/Tr9D 0b+ldEVEeKMJaIfjmQURpxqAhogHwwtQ8aNTGBJsuCTw6g6UX6Tb/nBnEA5EfiRHNdMFA1NtiZJMV j3mjrABSxAKCxiMwHijJ+GZR0rqlKQ674pt6oAkQjEmCpI86hkqnF1glQqMiVJRaU8dY=; 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.90_1) id 1gCMYn-002g29-5t for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:46 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id 331A620D96 for <openvpn-devel@lists.sourceforge.net>; Tue, 16 Oct 2018 12:26:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685598; bh=CDX946L3t8+Hjy/cpgSD+ucoRvdmu6zXIK8WpYnWQ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QsVxVvvRrJNQFkRwDSr9ykAbkYAaCAppz6I3H9yMK6NxmVF0LiY7JFypOkTkLTQ4V wExGTeRAcqb4XwIBgyH4IOBhx59J6hrrmC3AqkqO3oMZK2CLXp8SQmDFjbORtfXYLM VSSJZC4sT2onsIDH8yddV4CXMOZAO5e1nQ2c18tQ= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:38 +0200 From: Simon Rozman <simon@rozman.si> To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:27 +0200 Message-Id: <20181016102627.18676-5-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181016102627.18676-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> <20181016102627.18676-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:38.0081 (UTC) FILETIME=[B8A35F10:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches 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 X-Headers-End: 1gCMYn-002g29-5t Subject: [Openvpn-devel] [PATCH 5/5] Detect TAP interfaces with root-enumerated hardware ID X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel,1/5] Set output name to libopenvpnmsica.dll in MSVC builds too
|
|
Commit Message
Simon Rozman
Oct. 15, 2018, 11:26 p.m. UTC
This patch extends the TAP interface enumerating to detect the TAP interfaces registered using "root\tap0901" hardware ID. Before, only TAP interfaces with legacy "tap0901" HWID were detected by openvpn.exe. The openvpnmsica.dll and tapctl.exe install TAP interfaces using root- enumerated HWIDs, and were not detected by openvpn.exe. --- src/openvpn/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
Samuli, LGTM.
-----Original Message-----
From: Simon Rozman <simon@rozman.si>
Sent: Tuesday, October 16, 2018 3:26 AM
To: openvpn-devel@lists.sourceforge.net
Subject: [Openvpn-devel] [PATCH 5/5] Detect TAP interfaces with root-enumerated hardware ID
This patch extends the TAP interface enumerating to detect the TAP
interfaces registered using "root\tap0901" hardware ID. Before, only TAP
interfaces with legacy "tap0901" HWID were detected by openvpn.exe.
The openvpnmsica.dll and tapctl.exe install TAP interfaces using root-
enumerated HWIDs, and were not detected by openvpn.exe.
---
src/openvpn/tun.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 948fd17d..5fde2ab8 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -3524,7 +3524,8 @@ get_tap_reg(struct gc_arena *gc)
if (status == ERROR_SUCCESS && data_type == REG_SZ)
{
- if (!strcmp(component_id, TAP_WIN_COMPONENT_ID))
+ if (!strcmp(component_id, TAP_WIN_COMPONENT_ID) ||
+ !strcmp(component_id, "root\\" TAP_WIN_COMPONENT_ID))
{
struct tap_reg *reg;
ALLOC_OBJ_CLEAR_GC(reg, struct tap_reg, gc);
Hi, On Tue, Oct 16, 2018 at 12:26:27PM +0200, Simon Rozman wrote: > This patch extends the TAP interface enumerating to detect the TAP > interfaces registered using "root\tap0901" hardware ID. Before, only TAP > interfaces with legacy "tap0901" HWID were detected by openvpn.exe. > > The openvpnmsica.dll and tapctl.exe install TAP interfaces using root- > enumerated HWIDs, and were not detected by openvpn.exe. I do not see a specific reason to *not* apply this patch, but I'm wondering if you could shed some background light on the changed behaviour in openvpnmsica.dll and tapctl.exe? I'm not sure if we're going to care for someone who uses a 2.5 msi installer to set up a TAP interface and then runs a 2.3 openvpn.exe on top of it and wonders why it isn't finding the TAP driver - but the question might come up, and I like having good answers... :-) gert
Acked-by: Gert Doering <gert@greenie.muc.de> We have a LGTM from Jon as well, but I'm taking this on me - because I decided I want this in 2.4 as well. Unlikely as it may be, we *will* have people that happen to have a tap adapter on their system and try to run 2.4.x binaries on it... so this is long-term compatibility. Your patch has been applied to the master and release/2.4 branch. commit 6e03336d8a4aada12c4950a9683a483470fe4f15 (master) commit eef040cc909bb0e9bae793b61c2f4f0da7e109d5 (release/2.4) Author: Simon Rozman Date: Tue Oct 16 12:26:27 2018 +0200 Detect TAP interfaces with root-enumerated hardware ID Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20181016102627.18676-5-simon@rozman.si> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17762.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
Hi, > On Tue, Oct 16, 2018 at 12:26:27PM +0200, Simon Rozman wrote: > > This patch extends the TAP interface enumerating to detect the TAP > > interfaces registered using "root\tap0901" hardware ID. Before, only > > TAP interfaces with legacy "tap0901" HWID were detected by > openvpn.exe. > > > > The openvpnmsica.dll and tapctl.exe install TAP interfaces using root- > > enumerated HWIDs, and were not detected by openvpn.exe. > > I do not see a specific reason to *not* apply this patch, but I'm > wondering if you could shed some background light on the changed > behaviour in openvpnmsica.dll and tapctl.exe? The tapctl.exe and openvpnmsica.dll use a simplified interface installation compared to devcon.exe/tapinstall.exe. They assume the driver is already installed and they don't require INF file to create a TAP interface. However, when the interface is installed this way, Windows reports its hardware ID as "root\\tap0901". Whereas, tapinstall.exe installed TAP interfaces report their HWID as "tap0901". That's about the only difference I noticed. (Tested with driver versions 9.21.x and later.) Rather than exploring, what causes the difference and fuelled by Microsoft's recommendation to use root-enumerated HWIDs anyway, I proposed to extend the openvpn.exe's TAP interface detection to accept both: "tap0901" _and_ "root\\tap0901" interfaces. > I'm not sure if we're going to care for someone who uses a 2.5 msi > installer to set up a TAP interface and then runs a 2.3 openvpn.exe on > top of it and wonders why it isn't finding the TAP driver - but the > question might come up, and I like having good answers... :-) Suggest them to remove the TAP interface and reinstall it using tapinstall.exe. The tapinstall.exe should still be able to install 9.22 and later TUN interfaces. Or even better: apply this patch to 2.4 and 2.3 branches (it's a really minor change) and ask them to compile and use the patched version of 2.3. :) Best regards, Simon
Hi, On Sat, Jan 19, 2019 at 05:38:27PM +0000, Simon Rozman wrote: > > > The openvpnmsica.dll and tapctl.exe install TAP interfaces using root- > > > enumerated HWIDs, and were not detected by openvpn.exe. > > > > I do not see a specific reason to *not* apply this patch, but I'm > > wondering if you could shed some background light on the changed > > behaviour in openvpnmsica.dll and tapctl.exe? > > The tapctl.exe and openvpnmsica.dll use a simplified interface installation > compared to devcon.exe/tapinstall.exe. They assume the driver is already > installed and they don't require INF file to create a TAP interface. > However, when the interface is installed this way, Windows reports its > hardware ID as "root\\tap0901". Whereas, tapinstall.exe installed TAP > interfaces report their HWID as "tap0901". That's about the only difference > I noticed. O-kay... :-) - I do not know enough about driver *installation* on Windows to know whether this is all good or there might be dragons lurking. We'll have to test quite a bit, it seems :-) > (Tested with driver versions 9.21.x and later.) > > Rather than exploring, what causes the difference and fuelled by Microsoft's > recommendation to use root-enumerated HWIDs anyway, I proposed to extend the > openvpn.exe's TAP interface detection to accept both: "tap0901" _and_ > "root\\tap0901" interfaces. Works for me. Which is why I ... > Or even better: apply this patch to 2.4 and 2.3 branches (it's a really > minor change) and ask them to compile and use the patched version of 2.3. :) ... applied it to 2.4 as well. If someone struggles with 2.3 on windows (beyond XP), my empathy for them will be close to zero. 2.4 is so much better, especially on windows, that there is no reason to stick to 2.3... (on Linux distributions, sticking to the "distro provided package" might give people 2.3.x for years to come :-( - but this is no argument on Windows). gert
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 948fd17d..5fde2ab8 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3524,7 +3524,8 @@ get_tap_reg(struct gc_arena *gc) if (status == ERROR_SUCCESS && data_type == REG_SZ) { - if (!strcmp(component_id, TAP_WIN_COMPONENT_ID)) + if (!strcmp(component_id, TAP_WIN_COMPONENT_ID) || + !strcmp(component_id, "root\\" TAP_WIN_COMPONENT_ID)) { struct tap_reg *reg; ALLOC_OBJ_CLEAR_GC(reg, struct tap_reg, gc);