From patchwork Wed Aug 17 14:13:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2683 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.27.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id iYLUD04l/mKrMgAAIUCqbw (envelope-from ) for ; Thu, 18 Aug 2022 07:41:02 -0400 Received: from proxy10.mail.iad3a.rsapps.net ([172.27.255.1]) by director10.mail.ord1d.rsapps.net with LMTP id kKPvDk4l/mJCCQAApN4f7A (envelope-from ) for ; Thu, 18 Aug 2022 07:41:02 -0400 Received: from smtp1.gate.iad3a ([172.27.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3a.rsapps.net with LMTPS id RHPKBk4l/mLGAwAAnQ/bqA (envelope-from ) for ; Thu, 18 Aug 2022 07:41:02 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: patchwork@openvpn.net X-Originating-Ip: [192.26.174.232] Authentication-Results: smtp1.gate.iad3a.rsapps.net; iprev=pass policy.iprev="192.26.174.232"; spf=pass smtp.mailfrom="arne@rfc2549.org" smtp.helo="mail.blinkt.de"; dkim=none (message not signed) header.d=none; dmarc=fail (p=none; dis=none) header.from=unstable.cc X-Suspicious-Flag: NO X-Classification-ID: a1c852a0-1eea-11ed-97b4-52540091dea5-1-1 Received: from [192.26.174.232] ([192.26.174.232:47984] helo=mail.blinkt.de) by smtp1.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id DF/EE-30080-D452EF26; Thu, 18 Aug 2022 07:41:01 -0400 Received: from [195.70.183.100] (helo=[192.168.12.111]) by mail.blinkt.de with esmtpsa (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.95 (FreeBSD)) (envelope-from ) id 1oOdtU-0000SP-16 for patchwork@openvpn.net; Thu, 18 Aug 2022 13:41:00 +0200 Resent-From: Arne Schwabe Resent-To: patchwork@openvpn.net Resent-Date: Thu, 18 Aug 2022 13:40:58 +0200 Resent-Message-ID: <8b86b7ad-ddc7-6565-0cd5-78819f729b93@rfc2549.org> Received: from mail.blinkt.de ([unix socket]) by mail.blinkt.de (Cyrus 3.4.4) with LMTPA; Thu, 18 Aug 2022 02:15:41 +0200 X-Cyrus-Session-Id: mail.blinkt.de-1660781741-89006-1-9518157602987763690 X-Sieve: CMU Sieve 3.0 Received: from lists.sourceforge.net ([216.105.38.7]) by mail.blinkt.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95 (FreeBSD)) (envelope-from ) id 1oOTCH-000N9e-25 for arne@rfc2549.org; Thu, 18 Aug 2022 02:15:41 +0200 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.95) (envelope-from ) id 1oOTB6-000826-9Y; Thu, 18 Aug 2022 00:14:28 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oOTB5-00081x-4K for openvpn-devel@lists.sourceforge.net; Thu, 18 Aug 2022 00:14:27 +0000 Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oOTB1-0006iK-Od for openvpn-devel@lists.sourceforge.net; Thu, 18 Aug 2022 00:14:27 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 54CB3420D; Thu, 18 Aug 2022 02:14:16 +0200 (CEST) Received: by smtp.mailfence.com with ESMTPSA ; Thu, 18 Aug 2022 02:14:13 +0200 (CEST) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Thu, 18 Aug 2022 02:13:58 +0200 Message-Id: <20220818001358.175361-1-a@unstable.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-ContactOffice-Account: com:375058688 X-Headers-End: 1oOTB1-0006iK-Od Subject: [Openvpn-devel] [PATCH] close_tun: print interface type consistently in message 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-Spam-Bar: + X-getmail-retrieved-from-mailbox: Inbox When closing the tunnel interface we know if we were using DCO or not. for this reason we can customize the closing message and make it consistent with the opening one. Signed-off-by: Antonio Quartulli --- src/openvpn/init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index e8335c53..92c4cab9 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1921,7 +1921,15 @@ do_open_tun(struct context *c) static void do_close_tun_simple(struct context *c) { - msg(D_CLOSE, "Closing TUN/TAP interface"); + if (dco_enabled(&c->options)) + { + msg(D_CLOSE, "Closing DCO interface"); + } + else + { + msg(D_CLOSE, "Closing TUN/TAP interface"); + } + if (c->c1.tuntap) { close_tun(c->c1.tuntap, &c->net_ctx);