Skip to contentSkip to conversation

Change in openvpn[master]: win: Fix nrpt_dnssec flag handling

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Apr 4 – Apr 5 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1775320419000.Iff5be978817bfc0cd4d78818e7be7b90bad71f3c@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email

to review the following change.

Change subject: win: Fix nrpt_dnssec flag handling
......................................................................

win: Fix nrpt_dnssec flag handling

By default the first enum value is 0.
But we check whether we set the flag by doing
BOOL dnssec = (msg->flags & nrpt_dnssec) != 0;
This can't ever be true.

Found by cppcheck.

Change-Id Iff5be978817bfc0cd4d78818e7be7b90bad71f3c

---
M include/openvpn-msg.h

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1606/1

include/openvpn-msg.h +1 -1
index bef20cf..ca3267e 100644
@@ -110,7 +110,7 @@
 
 typedef enum
 {
-    nrpt_dnssec
+    nrpt_dnssec = 1 << 0,
 } nrpt_flags_t;
 
 #define NRPT_ADDR_NUM  8  /* Max. number of addresses */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff5be978817bfc0cd4d78818e7be7b90bad71f3c
Gerrit-Change-Number: 1606
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: d12fk, flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email )

Change subject: win: Fix nrpt_dnssec flag handling
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff5be978817bfc0cd4d78818e7be7b90bad71f3c
Gerrit-Change-Number: 1606
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-Comment-Date: Sun, 05 Apr 2026 10:21:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 win: Fix nrpt_dnssec flag handling

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

By default the first enum value is 0.
But we check whether we set the flag by doing
BOOL dnssec = (msg->flags & nrpt_dnssec) != 0;
This can't ever be true.

Found by cppcheck.

Change-Id Iff5be978817bfc0cd4d78818e7be7b90bad71f3c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1606
---

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/+/1606
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

include/openvpn-msg.h +1 -1
index bef20cf..ca3267e 100644
@@ -110,7 +110,7 @@
 
 typedef enum
 {
-    nrpt_dnssec
+    nrpt_dnssec = 1 << 0,
 } nrpt_flags_t;
 
 #define NRPT_ADDR_NUM  8  /* Max. number of addresses */
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: win: Fix nrpt_dnssec flag handling

Good catch, and obvious bug... and use of enum for a "bit map style" flags thing was not really a good approach in the first place. Now it will work ("any value *but* 0 will work"), but when this is extended to cover "more than 1 flag", going away from the enum would be a good plan. For the bug fix, a minimal approach is suitable.

I have not tested this beyond "does it compile on Ubuntu/MinGW", but it looks very obviously correct ("stare at 'git grep nrpt_dnssec'").

Your patch has been applied to the master and release/2.7 branch.

commit 08a19843a184c6cb8850ac9e6bf7ce0cd4d15d37 (master) commit 2aaa5e4d7c5bae35d7befdebeed065c634292151 (release/2.7)

Author: Frank Lichtenheld
Date:   Sun Apr 5 12:22:04 2026 +0200
     win: Fix nrpt_dnssec flag handling

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1606
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg36487.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: win: Fix nrpt_dnssec flag handling
......................................................................

win: Fix nrpt_dnssec flag handling

By default the first enum value is 0.
But we check whether we set the flag by doing
BOOL dnssec = (msg->flags & nrpt_dnssec) != 0;
This can't ever be true.

Found by cppcheck.

Change-Id Iff5be978817bfc0cd4d78818e7be7b90bad71f3c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1606
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36487.html

---
M include/openvpn-msg.h

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1606/2

include/openvpn-msg.h +1 -1
index bef20cf..ca3267e 100644
@@ -110,7 +110,7 @@
 
 typedef enum
 {
-    nrpt_dnssec
+    nrpt_dnssec = 1 << 0,
 } nrpt_flags_t;
 
 #define NRPT_ADDR_NUM  8  /* Max. number of addresses */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff5be978817bfc0cd4d78818e7be7b90bad71f3c
Gerrit-Change-Number: 1606
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email )

Change subject: win: Fix nrpt_dnssec flag handling
......................................................................

win: Fix nrpt_dnssec flag handling

By default the first enum value is 0.
But we check whether we set the flag by doing
BOOL dnssec = (msg->flags & nrpt_dnssec) != 0;
This can't ever be true.

Found by cppcheck.

Change-Id Iff5be978817bfc0cd4d78818e7be7b90bad71f3c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1606
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36487.html

---
M include/openvpn-msg.h

1 file changed, 1 insertion(+), 1 deletion(-)
include/openvpn-msg.h +1 -1
index bef20cf..ca3267e 100644
@@ -110,7 +110,7 @@
 
 typedef enum
 {
-    nrpt_dnssec
+    nrpt_dnssec = 1 << 0,
 } nrpt_flags_t;
 
 #define NRPT_ADDR_NUM  8  /* Max. number of addresses */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1606?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff5be978817bfc0cd4d78818e7be7b90bad71f3c
Gerrit-Change-Number: 1606
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>