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) {