From patchwork Fri May 8 15:34:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4925 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:a719:b0:84a:48f:a1fd with SMTP id hl25csp182217mab; Fri, 8 May 2026 08:35:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AFNElJ+ZFN6/WGzR1ukpy1E1GKgiqCC9kdCx2ihMxawFqc+Lbb9oE/0IDWoKDwpZz4YPsu4ZrSh56wrAGfk=@openvpn.net X-Received: by 2002:a05:701a:c951:b0:11b:bf3f:5240 with SMTP id a92af1059eb24-131965af31fmr6539880c88.9.1778254553789; Fri, 08 May 2026 08:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778254553; cv=none; d=google.com; s=arc-20240605; b=c82zykwK0kWkwiFAl8CKzv6vxB+dXqKbPt8cVr1j64sIY/Rir5Ful6F4zg6gpoLR6a j//CFYSmnHkY0/uXhnlg1mFRbVR8hrgZroqYpAnRzAMYtXNiXmRvj8a1lGHN0hM8rF3Y S5yPu2g7len+fIuZJgEPrmu4pVjpvaO62En/6aheE4d3w496oy7hwf3Z2TWDf+qvLLlz /1ePXHEHXjGqra5XFKe6QIy0XkhYnp104qvgtjpfuKusFgvVosCbeMOYumJ8U5761Iin WWJxhj54k7D9slg/xhEoNbTenLOYDpJJroNH864A7XxC4GGcs7zJXhiRnLEXPJAfYWk3 13hA== 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:dkim-signature; bh=AF586X1sTHuB1rYvCbnvDa1NLHHizcDyXmyZckv+2q8=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ebP7K7IaoXsrRk1o/G6w2Qm+QgAAR+6htv+dH5YRnVPISKhrN/GnFzqwN9qXnwEiiz HmrdSwAzaZVzGxA1O6cNr8TdcP+hZgUAfypayYX6FvgVpFZfC5rwXGLFuc6yFLyjtrYM 0/HRAO8ygFaV6LzYxhN/l53vUSLt4JAzlXSNejYlpCLp+PTRIaeXLfVFbJWD2ap/KVvI BjtC5usFbOfisk8LFZF/zic6JczNJEvAKSOHzTqE3KN3/B6sEOHewLUOobofWxEjL9YH cl2tJK23tdJm55aOPTX51i3rl3HNMgwbWPQ2M+J9PHAq7+SlBSRz6WyyzpxAdDlY46kz SXmQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Iiy9CNBT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EIKEpzS5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UoIHyubf; 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 a92af1059eb24-1327897e6a5si5706214c88.64.2026.05.08.08.35.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2026 08:35:53 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=Iiy9CNBT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EIKEpzS5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UoIHyubf; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AF586X1sTHuB1rYvCbnvDa1NLHHizcDyXmyZckv+2q8=; b=Iiy9CNBTRtnKsfzBvExk1AkPD+ s60NztrUX8+mlDH7cg2YC/2vkYRXmypjX+Yiq45ByfuSdvbDrC5vAPgGAke0mLcUo6+ghIBo0Mhtq LR5xYOPqjqbJH42f2dBfQBoYfrXRtyEwFXSZCYnYDxbyCD/hPpKYO2ubQYESdoHsfF7A=; 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.95) (envelope-from ) id 1wLNEU-0007CB-7l; Fri, 08 May 2026 15:35:18 +0000 Received: from [172.30.29.66] (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.95) (envelope-from ) id 1wLNER-0007C2-Kx for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2026 15:35:15 +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=T1jM+oaybWRHy46S4PuUK11OJQemshfweD+EZin6cHE=; b=EIKEpzS5EU9JTsYMZEpoJjKjQI mlIQbtGhntyAxvilEwcR2mx7i1RO0e8Xo+h83J/x8sVkfLddw7NrkfVKiGDWHvOVa9AFzXvSUzext zdcqkCTQNMXTsWNSuH2JMAkYOfwHS0MM154sIv92g1YgwST1vE7KPIyBmCn8mJ5JpuD4=; 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=T1jM+oaybWRHy46S4PuUK11OJQemshfweD+EZin6cHE=; b=UoIHyubf7cUEqVaX4iHFR95M8f tVMlgsGDefBb+Uwr2h7uyQ65tHDdqBGoYXiqeKWMZgHlll6f7sJD8Ww1ydqA0bqg/UQo355dn9xEn JuEYGLDL0ZKEvGAgRIrcLK/ItGpknVXoxY6Dhzn/fDl0I5AR7aWmgKfUWC3X0gWxDy5Q=; Received: from [193.149.48.129] (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 1wLNEM-0007gy-MT for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2026 15:35:14 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 648FYxPj013859 for ; Fri, 8 May 2026 17:34:59 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 648FYxPW013858 for openvpn-devel@lists.sourceforge.net; Fri, 8 May 2026 17:34:59 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 8 May 2026 17:34:53 +0200 Message-ID: <20260508153458.13848-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: Frank Lichtenheld The condition was already checked in an outer if check. Identified by cppcheck. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wLNEM-0007gy-MT Subject: [Openvpn-devel] [PATCH v1] tun: Remove one useless if check 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?1864635047114944268?= X-GMAIL-MSGID: =?utf-8?q?1864635047114944268?= From: Frank Lichtenheld The condition was already checked in an outer if check. Identified by cppcheck. Change-Id: I0aeb4583707a80592ec2577fbb060f7fbcb73e48 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1677 --- 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/+/1677 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index f46802f..e7193d8 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5772,13 +5772,10 @@ continue; } - if (tt->backend_driver == DRIVER_DCO) + const char *last_sep = strrchr(dev_if->device_interface, '\\'); + if (!last_sep || strcmp(last_sep + 1, DCO_WIN_REFERENCE_STRING) != 0) { - char *last_sep = strrchr(dev_if->device_interface, '\\'); - if (!last_sep || strcmp(last_sep + 1, DCO_WIN_REFERENCE_STRING) != 0) - { - continue; - } + continue; } path = dev_if->device_interface;