From patchwork Tue Apr 7 20:52:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4881 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:d1c6:b0:83c:d90d:321 with SMTP id ly6csp2303461mab; Tue, 7 Apr 2026 13:52:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUukg4tQv0vxzBgqt7DjJopLAx/q67qQusa7wbk+7GuV5uEp+/n9OQSw1ek5KRP8ZJurTD90LJCR9g=@openvpn.net X-Received: by 2002:a05:6820:61b:b0:685:b047:2d0b with SMTP id 006d021491bc7-685b0472ee2mr6029883eaf.41.1775595168713; Tue, 07 Apr 2026 13:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775595168; cv=none; d=google.com; s=arc-20240605; b=HBO7+4ZBPjvtoVIrsGxppvixspyfyjQ+N8DpmlsRnYL0mCYDF6dDOcdVPlodRUs7Oa NI8gYHE7dWnuZ4kcZrYnPrDcVEjnCnlPN57jgIoYN2hSQ0byfrQqn8gs7dFSq0/sAR7z mB6BRCfYM//K1xeXcK5bKv5nKHK/KwyyQN4rNVHvuyurlOovJUz5VNDKO1yTazC6IRy+ 2jzP4RkV+liJRccC8SPrM5o0rSYRKEHfLplB7JaaSssm5QA+7piDaD7Uxoquqy5Lm2XF kI8BD4gYwbe1ES3YB9qAYwUr1kYKa+BvWVs0JB74aJ9umq/QbRYdqu+joxfrQF39op0f pyoQ== 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=qQ0xfDER4PfvSFED4lNt30mehxeqZQ17VkIGqSiUm88=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=U9ahUyC/tAPLRDWq5mX+IArSYqPyZ7q2Ql04D91QhWKjoEI4X+ackQi9n+LLNIDjnh 6BIUcNX7yIX1NXZL6KEz0Jqk9Z1nnQB07hKPRFnGwWmT6yftyCxIYaJJrIcNeiYj2j05 ztR4XZQZ7ZbAKqaI3VEvP1qBiAszBQlsphDsdnf8I7gkrb1Ww9VBcz9J6SY7XAQx4BAC YScEpj/kgWrWHe+BKUyOnvePQZNIDilI7v79mxyS96bx8SGd7vTDb5lcHfJOTwzyfzZJ LjdUDlh53qvyRe5QllVtVBWGzwtUEqXkWqtAgK5h3KX4MK55qUyw1qCpN6+35MPOHV9X A37Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=jmurJCXM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QfYdo2t9; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PXrK6Av7; 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 006d021491bc7-683800703dbsi8176985eaf.64.2026.04.07.13.52.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2026 13:52:48 -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=jmurJCXM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QfYdo2t9; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PXrK6Av7; 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=qQ0xfDER4PfvSFED4lNt30mehxeqZQ17VkIGqSiUm88=; b=jmurJCXMjcD8L4Sp2eDWr2+xjL bNxdTOxO2ZenWS7lCJHfTjeBCPrV2WSsMk2xKsFvTyVFxA609PH2dccdzkrggdbDZjWnqs5h+I7Qv UoHfNcdgwyL2T3UjmvY083GsJ4VJOdMvEiZqb2f/p+T5hCQMzluxSmZDJZ5rgFrIVCIo=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wADPh-0006iw-Ub; Tue, 07 Apr 2026 20:52:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wADPg-0006iq-K4 for openvpn-devel@lists.sourceforge.net; Tue, 07 Apr 2026 20:52:44 +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=crh2guX00kTAGVBTXzBohDr9A5KfZmJwZPBC2X2NFyY=; b=QfYdo2t9rz4zEiH5VhBxNbMxbc DYwgBgr+pUoLvVjrUrge1o7/lSvzgmp4gJkE74hUGWh6qj8AFusv55U+bAWDFwopw4oBW/0RozDlR fcGwsntJaA2jm3r0iHQch+tCN9nE7HH5OwLTA97cCLlYf607hT54YpjCiitFBtgpZ3Uc=; 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=crh2guX00kTAGVBTXzBohDr9A5KfZmJwZPBC2X2NFyY=; b=PXrK6Av7S1EPyW8rBMRyoIz5h8 NJfjiLUtvbUPnaIOZvrZw2TXhlUrGOyXB/fXqTNhXbTOxliGuz3O9lFpyIJVvwqku1iJ5XIurErGt MxJPWFpeT6GN13LxdJRKxDMxg/qygUfbDiluQgfHPb0a2SIaHmFRMt6Odb7Z7eIQbfVk=; 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 1wADPf-0003Zf-6U for openvpn-devel@lists.sourceforge.net; Tue, 07 Apr 2026 20:52:44 +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 637KqaAH031151 for ; Tue, 7 Apr 2026 22:52:36 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 637Kqaet031150 for openvpn-devel@lists.sourceforge.net; Tue, 7 Apr 2026 22:52:36 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Apr 2026 22:52:28 +0200 Message-ID: <20260407205235.31126-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 As suggested by cppcheck. Change-Id: Ia153e0de888c0ee21199b192f3471ce4c08cb5c7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] 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: 1wADPf-0003Zf-6U Subject: [Openvpn-devel] [PATCH v2] Clarify operator precedence in a & b ? c : d 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?1861846479645556104?= X-GMAIL-MSGID: =?utf-8?q?1861846479645556104?= From: Frank Lichtenheld As suggested by cppcheck. Change-Id: Ia153e0de888c0ee21199b192f3471ce4c08cb5c7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1619 --- 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/+/1619 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/error.h b/src/openvpn/error.h index 62389af..03d880f 100644 --- a/src/openvpn/error.h +++ b/src/openvpn/error.h @@ -399,7 +399,7 @@ static inline msglvl_t nonfatal(const msglvl_t err) { - return err & M_FATAL ? (err ^ M_FATAL) | M_NONFATAL : err; + return (err & M_FATAL) ? (err ^ M_FATAL) | M_NONFATAL : err; } static inline int diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 186b2d2..e4905c9 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7043,12 +7043,12 @@ if (options->routes->flags & RG_REROUTE_GW) { setenv_int(es, "route_redirect_gateway_ipv4", - options->routes->flags & RG_BLOCK_LOCAL ? 2 : 1); + (options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1); } if (options->routes_ipv6 && (options->routes_ipv6->flags & RG_REROUTE_GW)) { setenv_int(es, "route_redirect_gateway_ipv6", - options->routes->flags & RG_BLOCK_LOCAL ? 2 : 1); + (options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1); } #ifdef _WIN32 /* we need this here to handle pushed --redirect-gateway */ diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index f60e2f2..7fc8c14 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -276,7 +276,7 @@ const WCHAR *mesg[] = { msg[0], msg[1] }; ReportEvent(hEventSource, - flags & MSG_FLAGS_ERROR ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE, + (flags & MSG_FLAGS_ERROR) ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE, 0, EVT_TEXT_2, NULL,