From: "flichtenheld (Code Review)" Date: Fri, 6 Mar 2026 11:39:26 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <5c27d3b7a16f51dbd4a2bddef4e9004deb7b0ca9-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="c+I3/qmoY/I="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Optimise performance of iterating over all client by remembering high... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --c+I3/qmoY/I= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. flichtenheld has posted comments on this change by plaisthos. ( http://gerr= it.openvpn.net/c/openvpn/+/1557?usp=3Demail ) Change subject: Optimise performance of iterating over all client by rememb= ering highest peer id ...................................................................... Patch Set 1: Code-Review-1 (1 comment) File src/openvpn/multi.c: http://gerrit.openvpn.net/c/openvpn/+/1557/comment/d4a87d22_1c3297f5?usp=3D= email : PS1, Line 4109: if (mi->context.c2.tls_multi->peer_id > m->max_peerid) I would suggest moving this code below the ASSERT. In the end it makes no d= ifference. But I think it is easier to read if the code that checks that th= e loop failed is directly below the loop. As an aside I think the ASSERT is a bit unclear already. I think what it ac= tually should check is against MAX_PEER_ID, not max_clients. From this code= it is not clear that it assumes that peer_id was initialized to MAX_PEER_I= D. So I think it would be better to have an ASSERT at the top of the functi= on that checks that peer_id is indeed MAX_PEER_ID and then an assert below = that checks that peer_id is not MAX_PEER_ID. Much clearer. But not directly= the job of this patch. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1557?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: comment Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If797f3fe178fba3f43fb12898e5484bfb38f05c3 Gerrit-Change-Number: 1557 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Comment-Date: Fri, 06 Mar 2026 11:39:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes --c+I3/qmoY/I= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

Patch set 1:Code-Review -1=

V= iew Change

1 comment:

  • File src/openvpn/multi.c:

  • Patch Set #= 1, Line 4109: if (m= i->context.c2.tls_multi->peer_id > m->max_peerid)

    I = would suggest moving this code below the ASSERT. In the end it makes no dif= ference. But I think it is easier to read if the code that checks that the = loop failed is directly below the loop.

    As an aside I think the ASSERT = is a bit unclear already. I think what it actually should check is against = MAX_PEER_ID, not max_clients. From this code it is not clear that it assume= s that peer_id was initialized to MAX_PEER_ID. So I think it would be bette= r to have an ASSERT at the top of the function that checks that peer_id is = indeed MAX_PEER_ID and then an assert below that checks that peer_id is not= MAX_PEER_ID. Much clearer. But not directly the job of this patch.

To view, visit change 1557. To unsubscribe, or for help writ= ing mail filters, visit settings.

=
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If797f3fe178fba3f43fb12898e5= 484bfb38f05c3
Gerrit-Change-Number: 1557
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Comment-Date: Fri, 06 Mar 2026 11:39:26= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
= --c+I3/qmoY/I=--