From patchwork Wed Aug 3 09:42:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 2624 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id gLuIE+jP6mJgNAAAIUCqbw (envelope-from ) for ; Wed, 03 Aug 2022 15:43:36 -0400 Received: from proxy12.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id kO6GE+jP6mJ8VAAA91zNiA (envelope-from ) for ; Wed, 03 Aug 2022 15:43:36 -0400 Received: from smtp3.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.ord1d.rsapps.net with LMTPS id SGk2E+jP6mJuNgAA7PHxkg (envelope-from ) for ; Wed, 03 Aug 2022 15:43:36 -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: smtp3.gate.ord1d.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; dmarc=none (p=nil; dis=none) header.from=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: 8feb29c2-1364-11ed-8d12-5254006d4589-1-1 Received: from [216.105.38.7] ([216.105.38.7:35214] helo=lists.sourceforge.net) by smtp3.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id CF/3F-07358-7EFCAE26; Wed, 03 Aug 2022 15:43:35 -0400 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.94.2) (envelope-from ) id 1oJKGC-00021p-NR; Wed, 03 Aug 2022 19:42:27 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oJKGA-00021i-B8 for openvpn-devel@lists.sourceforge.net; Wed, 03 Aug 2022 19:42:25 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9Cr6v2uY4sCUboL04iy54rJoar269Sxf4UwlPb3bj5Q=; b=Qpw5bSlGLnI8cUkR5JJzi5063C k7kd1PeV9BK6F/I4qv5FBgyHGvhhjuXkHnaHTbkZK9k0YnptaHlm1KGL5UFcHmLIlEDXfmFTUUA7J M0jCUn53STiYzBR+nFjpAi+Am2IxZTUmCPxTWYJpAz1LruYFYvZlyucbFfxvaPT0Rz/s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=9Cr6v2uY4sCUboL04iy54rJoar269Sxf4UwlPb3bj5Q=; b=b gfsLRYXnYeiX+asCINv0NPu9vuQAeYZXzNaPWn1b+ZzvLZATebVvjrKp+x8T2lscLxFMw5cg5rAVp wYEdOckX+4Ezw4SD6DXfuzoGCm9Hkg1UPbaI3LJRriLtJ81SIe5LvaEEtd2sCek2wQr8aMs5r7SN+ lKNwwn/N5dZF1fTQ=; Received: from vmail1.greenie.net ([195.30.8.66]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oJKG5-00017n-5p for openvpn-devel@lists.sourceforge.net; Wed, 03 Aug 2022 19:42:24 +0000 Received: from ubuntu2004.ov.greenie.net (ubuntu2004.ov.greenie.net [IPv6:2001:608:1:995a:250:56ff:febb:2084]) by vmail1.greenie.net (8.17.1/8.16.1) with SMTP id 273JgBfH086270 for ; Wed, 3 Aug 2022 21:42:11 +0200 (CEST) Received: (nullmailer pid 1727870 invoked by uid 1000); Wed, 03 Aug 2022 19:42:11 -0000 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 3 Aug 2022 21:42:11 +0200 Message-Id: <20220803194211.1727822-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (vmail1.greenie.net [IPv6:2001:608:1:995a:20c:29ff:feb8:10eb]); Wed, 03 Aug 2022 21:42:11 +0200 (CEST) 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: If we get a permission denied error on one DCO device, trying 255 more times will not succeed, and just fill the log file with errors. Also, remove the msg() call there because it was at debug level (needed --verb 4 to be seen), didn't see the correct errno, and the sitnl code already prints the error. Content analysis details: (-2.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.30.8.66 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1oJKG5-00017n-5p Subject: [Openvpn-devel] [PATCH] Break 'try 256 dco devices' loop on EPERM 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 If we get a permission denied error on one DCO device, trying 255 more times will not succeed, and just fill the log file with errors. Also, remove the msg() call there because it was at debug level (needed --verb 4 to be seen), didn't see the correct errno, and the sitnl code already prints the error. Signed-off-by: Gert Doering --- src/openvpn/tun.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 02ded4d7..90cfc3bd 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1883,13 +1883,18 @@ open_tun_dco_generic(const char *dev, const char *dev_type, { openvpn_snprintf(dynamic_name, sizeof(dynamic_name), "%s%d", dev, i); - if (open_tun_dco(tt, ctx, dynamic_name) == 0) + int ret = open_tun_dco(tt, ctx, dynamic_name); + if (ret == 0) { dynamic_opened = true; msg(M_INFO, "DCO device %s opened", dynamic_name); break; } - msg(D_READ_WRITE | M_ERRNO, "Tried opening %s (failed)", dynamic_name); + /* "permission denied" won't succeed if we try 256 times */ + if (ret == -EPERM) + { + break; + } } if (!dynamic_opened) {