| Message ID | 20260511200645.24711-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:a719:b0:84a:48f:a1fd with SMTP id
hl25csp2019308mab;
Mon, 11 May 2026 13:07:00 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AFNElJ+xlkT2pR+5JMJn4vqepApkmRCLzvssaZBTr17R5EhhQr1WhQb7VjAPTbZzwwAyPOQetb3fqYkz1Qo=@openvpn.net
X-Received: by 2002:a05:6820:1c9d:b0:68e:b81b:d81b with SMTP id
006d021491bc7-69b36d27450mr5592556eaf.31.1778530020113;
Mon, 11 May 2026 13:07:00 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1778530020; cv=none;
d=google.com; s=arc-20240605;
b=Zfqpnnkpj3o41xHdqLQ/RG53C24bA8JlZ5UE+eBkz232UOi6sMFYmpZ5blOo4b/HeT
685TvTHren8EAyCk7xH0DBMLIedQwE7fX/4S9T7NkZmqBpMNcgv35iB5+ZFLolQAs6nM
mau5Wv+QZTThMd4hbkggFh+uLlLqaaRupO4fHjAfViheQYKKmTICJKVOeOTUI2aegydu
maRzZ00AVOGHWg0hiBnqP44nm+3YRnjIVUZuHKYXLxID3grfgGqMvqVC0ZvnY4MMAQFE
pftbb8Y3eV+pRxXeh+83h9xngOHZ0Ps5sdSBC6MiTTiO+QlZCJMp89LbeCGdJZnlZJcl
1h5g==
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=bSfRVn7TOk65WnWDViTb6NlYwa7TKQZuPyuAJIzxS5c=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=PuXUknUXt57DXpYHK2JM3MDpDnqkt6I7uIRyn0q5na27SN1jevjuz6kLQtyKJ1xoy+
ykOJ/riUWirhCW6+5BURsT+ZF7JsFTom63jmW/hcqO14Mr3Fx5DipexX92cwB6IaM05V
SeKWrsRgi/8m9iPdfuh98PmYsi+kcaAwy0rS2HhBMpVXKDjkl9gsWziNp8eIxhP+G+ZB
hhepfdTg1raSFfkmwTp2bzjcWxUYkLhinXyAmYvw92JgPOwZqdfn4uIHairrzoLN9Gc4
MQmt+SBeNFh8qfQn5nsgah3kyopqQG5o0jJ7GK+rgHwdzGt0UfDyVagY7ziXrSlYut8o
s3lw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=SIWGlZ9Z;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=cWbRkn28;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=RyUWZqh1;
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-69b5fa5645asi1026392eaf.84.2026.05.11.13.06.59
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 11 May 2026 13:06:59 -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=SIWGlZ9Z;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=cWbRkn28;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=RyUWZqh1;
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=bSfRVn7TOk65WnWDViTb6NlYwa7TKQZuPyuAJIzxS5c=; b=SIWGlZ9ZXNl95zg5Bzm4wLUgFW
rcQIjpQljJxzA2Q237SxesjGHAe0h8vjJvqOEoaqwIauAhLMSkxMvyewF3MXRog8sGqE1V1iWqEp1
Cd83RsVfFfWQD++jkVjVRG3r4ASJZzjRo9ra4BPp2thyU+xJO3Uvd7bvU0RQcxyDkU74=;
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 <openvpn-devel-bounces@lists.sourceforge.net>)
id 1wMWu0-0005OR-5V;
Mon, 11 May 2026 20:06:56 +0000
Received: from [172.30.29.66] (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 <gert@blue4.greenie.muc.de>) id 1wMWtx-0005OB-Pl
for openvpn-devel@lists.sourceforge.net;
Mon, 11 May 2026 20:06:54 +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=mOCEg1rrZJ307/QCbPUPgT+2E++PAKmcd7mhOegkHc4=; b=cWbRkn288Dq0VVTFbrA6AVGMug
CqTBZi6Z1Wuz6CiuJ9BZj9RNxp50kxiwLJVI+xbHefpTX5x7HIYEpijalnHSV55yEar0jA7WSzfRo
9uEf3aw3ipQmqPPCJRYivCBG41bT6PQsokbjbSSWSo5YgF+BaSd2KhHkGw6O3OznGzx0=;
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=mOCEg1rrZJ307/QCbPUPgT+2E++PAKmcd7mhOegkHc4=; b=RyUWZqh1JO1M31E+Bbz84/Q5XP
fgnShho6PhwT47vsfrkqH1t0xW5oz8iebMjnNAK8fv7QyDE8U0lhwTlJuKgcHZzsKeMq2hAgxRWyC
EzZ7OWaAyDLK62HSe2YUjsd3GFyCk72S5nJpCm/8esoQxiTxJm6Cx8P/Xa8bi29H+vlU=;
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 1wMWtw-0001Fk-9n for openvpn-devel@lists.sourceforge.net;
Mon, 11 May 2026 20:06:54 +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 64BK6jqn024731
for <openvpn-devel@lists.sourceforge.net>; Mon, 11 May 2026 22:06:45 +0200
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 64BK6jkA024730
for openvpn-devel@lists.sourceforge.net; Mon, 11 May 2026 22:06:45 +0200
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Mon, 11 May 2026 22:06:39 +0200
Message-ID: <20260511200645.24711-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.52.0
In-Reply-To:
<gerrit.1778102459000.I5c9b54dca0a14688a3bb7798cb086f5bde7311b8@gerrit.openvpn.net>
References:
<gerrit.1778102459000.I5c9b54dca0a14688a3bb7798cb086f5bde7311b8@gerrit.openvpn.net>
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 <frank@lichtenheld.com> As suggested
by cppcheck. Change-Id: I5c9b54dca0a14688a3bb7798cb086f5bde7311b8
Signed-off-by:
Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering
<gert@greenie.muc.de>
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: 1wMWtw-0001Fk-9n
Subject: [Openvpn-devel] [PATCH v3] route: 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: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1864923894578418736?=
X-GMAIL-MSGID: =?utf-8?q?1864923894578418736?=
|
| Series |
[Openvpn-devel,v3] route: Clarify operator precedence in a & b ? c : d
|
|
Commit Message
Gert Doering
May 11, 2026, 8:06 p.m. UTC
From: Frank Lichtenheld <frank@lichtenheld.com> As suggested by cppcheck. Change-Id: I5c9b54dca0a14688a3bb7798cb086f5bde7311b8 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1668 --- 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/+/1668 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <gert@greenie.muc.de>
Comments
Thanks. This is not actually fixing a bug, but improving readability,
so very welcome. As it's not a bugfix, only applying to master.
Test compiled on MinGW.
Your patch has been applied to the master branch.
commit 9beebd0a80663550b187c6e2f54d8b2f6bfaaf25
Author: Frank Lichtenheld
Date: Mon May 11 22:06:39 2026 +0200
route: Clarify operator precedence in a & b ? c : d
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1668
Message-Id: <20260511200645.24711-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36880.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 3b18f74..81ce867 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2884,7 +2884,7 @@ .prefix.ipv4.s_addr = htonl(r->network), .gateway.ipv4.s_addr = htonl(r->gateway), .iface = { .index = if_index, .name = "" }, - .metric = (r->flags & RT_METRIC_DEFINED ? r->metric : -1) }; + .metric = (r->flags & RT_METRIC_DEFINED) ? r->metric : -1 }; netmask_to_netbits(r->network, r->netmask, &msg.prefix_len); if (msg.prefix_len == -1) @@ -2986,7 +2986,7 @@ .prefix_len = r->netbits, .gateway.ipv6 = r->gateway, .iface = { .index = tt->adapter_index, .name = "" }, - .metric = ((r->flags & RT_METRIC_DEFINED) ? r->metric : -1) }; + .metric = (r->flags & RT_METRIC_DEFINED) ? r->metric : -1 }; if (r->adapter_index) /* vpn server special route */ {