From patchwork Tue Sep 24 12:55:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3867 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:10cd:b0:5b9:581e:f939 with SMTP id j13csp2727570mae; Tue, 24 Sep 2024 05:55:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXuHhJHyoY/pCoN7si557++NaGTdzRwEyExZDCZ2ZTBdaT8a7UUwkGpdymHDExEh5UKgJ5nEY9IvhE=@openvpn.net X-Google-Smtp-Source: AGHT+IFd7jZs5YVht/GKoWTnEaCvYJcZBMh8TMsFElXVoF3fDo7M8M/by4GW0jLENCo4c6lKDQ5L X-Received: by 2002:a05:6e02:12e3:b0:3a0:a311:6773 with SMTP id e9e14a558f8ab-3a0c8d3ace3mr127444575ab.21.1727182533363; Tue, 24 Sep 2024 05:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727182533; cv=none; d=google.com; s=arc-20240605; b=WB5qRqBZE6+0KW6+N4a6CCu/7PnSt9PjfhoEOYGt8c05jb9TUC3Sh+zzGW7AGRfNoZ og1w25eUKuT1erPOk4vL2bDabZv5sfzs53nMbAjckTdUgIYTlTnosetjJrhYDervQCl4 4Hcyr07w5y6wonmg2adIT/55uiX0D7zX3VdWjWu3ckgTlvwA/XmLqyG2FkLlA8CdGZgD pkz7+SR75Ge/nv59q6sV+yF4GxUXFaWg/3P878rDP7a2TW9ZhlXBL53Hz0Iky8GRHv8S J6ThPK+C9L1klHiauXMLcHV+ympeUiN4VKYrTNmgDHotjFue9knSZf2ktlwxkaEbfbLf Dmyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=+AlN4lfIs8vGfOLgTQqP6qhIvKfG5TdWCVy5hvvhp4M=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=DeSq6iAXp7KRKEen3iZw9I4r+ek68yrpr+R1ZFZoy3EPL3EYrHeUijEykZhqrwMMBo WBaZlcFwSvh08oMBsTuW5/AMlrIIvMoC69EFA89B/7A+I9ayrVeDBqjgnH9EKRjCf5mA GqnnDYzxXa1AStKoWLbfFN5L3GprnxiqpN1xG+zjCwJDHSVrOWhHaUp6G+lu+W5aD1sm 58NRsh2gy19t7paeUK6T/7vHm7olSHyY3Y3Mkgnrx+/Q7acqGH7hsOKyzSd+bgCsaF8U 6HwRrZsBrYUV34yX/XZDBNAhx6jm3vVc0ZaL+ZEgn27nkmuhr3cdN/5Qwa6iGYsEIkVv GmuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jCbVxpre; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WI14yLF0; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a1a572d585si5842565ab.187.2024.09.24.05.55.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2024 05:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jCbVxpre; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WI14yLF0; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de 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.95) (envelope-from ) id 1st54h-0002QF-V1; Tue, 24 Sep 2024 12:55:28 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1st54g-0002Q7-D9 for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 12:55:27 +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:To:From:Sender:Reply-To:Cc: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=X6TLzWX3nQcLVBTxxHjHQQC+THPSkV9L7x+ywLeUh4Y=; b=jCbVxprehd/ZmHYqbLsUQ0bXPi BR/Q5ztxM0sFR+RW4P4MhYapr83KEDKz7R9RqCqbYdmwVsYQt2lqOBCppGGlNZV4c2wE+BUIm8A8g S2habuechsDJC1NB+ikWQ40nKZEx5RAOXU+fMOwgzk1LW6609/DSC7smhnd5Wm1omZus=; 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:To:From:Sender:Reply-To:Cc: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=X6TLzWX3nQcLVBTxxHjHQQC+THPSkV9L7x+ywLeUh4Y=; b=WI14yLF0pWWwGu8IFHC/CuReqo RODRRL2aVhvVkGGBnEooG39u5ca8/rhUlu9841G4aUBTbemjqCrQq5CkBCfZPcm3Escuq+zKdBSJH aWYoHHWz2QP0mOOGIk0imbVOw/l1cbgT6uuuZNtVjb3K0t3Ial3NwiaYDLHVAiJy4P9I=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1st54f-0001Hy-Ls for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 12:55:26 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 48OCtEWd010720 for ; Tue, 24 Sep 2024 14:55:14 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 48OCtEUJ010719 for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 14:55:14 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 24 Sep 2024 14:55:13 +0200 Message-ID: <20240924125513.10710-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.44.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe Also show the device type that we opened always instead of certain conditions only. Change-Id: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1st54f-0001Hy-Ls Subject: [Openvpn-devel] [PATCH v11] Use print_tun_backend_driver instead of custom code to print 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 X-GMAIL-THRID: =?utf-8?q?1811082151999388089?= X-GMAIL-MSGID: =?utf-8?q?1811082151999388089?= From: Arne Schwabe Also show the device type that we opened always instead of certain conditions only. Change-Id: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/749 This mail reflects revision 11 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/init.c b/src/openvpn/init.c index fbf2c5b..cd9203a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1876,6 +1876,7 @@ open_tun(c->options.dev, c->options.dev_type, c->options.dev_node, tt, &c->net_ctx); } + msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->backend_driver), tt->actual_name); } @@ -2056,7 +2057,7 @@ do_close_tun_simple(struct context *c) { msg(D_CLOSE, "Closing %s interface", - dco_enabled(&c->options) ? "DCO" : "TUN/TAP"); + print_tun_backend_driver(c->c1.tuntap->backend_driver)); if (c->c1.tuntap) { diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 770e806..206ddc0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6678,7 +6678,6 @@ * GUID using the registry */ tt->actual_name = string_alloc((const char *)actual_buffer, NULL); - msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->backend_driver), tt->actual_name); tt->adapter_index = get_adapter_index(*device_guid); } diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index b2c1b01..329cd10 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -361,6 +361,12 @@ void warn_on_use_of_common_subnets(openvpn_net_ctx_t *ctx); +/** + * Return a string representation of the tun backed driver type + */ +const char * +print_tun_backend_driver(enum tun_driver_type driver); + /* * Should ifconfig be called before or after * tun dev open? @@ -689,9 +695,6 @@ return tuntap_is_dco_win(tt) && (status < 0) && (openvpn_errno() == ERROR_NETNAME_DELETED); } -const char * -print_tun_backend_driver(enum tun_driver_type driver); - #else /* ifdef _WIN32 */ static inline bool