From: "mrbff (Code Review)" Date: Tue, 14 Oct 2025 16:05:02 +0000 In-Reply-To: References: Reply-To: marco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726..., gert@...1296... Message-ID: <12bb05d2ee14e18b5c32c5a7134914d95d1017bd-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="0IkVHuUwGJQ="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE server: remove old IP(s) from vhash after sending a messa... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: plaisthos , flichtenheld , openvpn-devel --0IkVHuUwGJQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, ordex, plaisthos. mrbff has posted comments on this change by mrbff. ( http://gerrit.openvpn.= net/c/openvpn/+/1253?usp=3Demail ) Change subject: PUSH_UPDATE server: remove old IP(s) from vhash after sendi= ng a message containing ifconfig(-ipv6) ...................................................................... Patch Set 6: (2 comments) File src/openvpn/multi.c: http://gerrit.openvpn.net/c/openvpn/+/1253/comment/fc5a283e_68bf4b30?usp=3D= email : PS5, Line 4390: mi->context.c2.push_ifconfig_local =3D htonl(ne= w_addr.s_addr); > something is weird here. [=E2=80=A6] yes I printed bit by bit and they are the same and I don't understand why h= tonl fixes things and I don't understand why (addr.s_addr =3D=3D htonl(add.= s_addr)) statement is false. uint32 2025-10-14 17:40:06 us=3D422285 MANAGEMENT: CMD 'push-update-cid 0 "ifconfi= g 10.10.10.55 255.255.255.0"' 2025-10-14 17:40:06 us=3D422386 SENT CONTROL [client0]: 'PUSH_UPDATE,ifconf= ig 10.10.10.55 255.255.255.0' (status=3D1) 2025-10-14 17:40:06 us=3D422409 MULTI: Unlearn: 10.10.10.2 -> client0/udp6:= 92.168.3.1:37467 2025-10-14 17:40:06 us=3D422422 MULTI: Learn: 10.10.10.55 -> client0/udp6:9= 2.168.3.1:37467 2025-10-14 17:40:06 us=3D422432 New IPv4 Address Analysis: 2025-10-14 17:40:06 us=3D422437 Original s_addr: 0x370a0a0a =3D 92340= 4810 =3D 00110111000010100000101000001010 2025-10-14 17:40:06 us=3D422442 ntohl(s_addr): 0x0a0a0a37 =3D 16843= 0135 =3D 00001010000010100000101000110111 2025-10-14 17:40:06 us=3D422448 htonl(s_addr): 0x0a0a0a37 =3D 16843= 0135 =3D 00001010000010100000101000110111 2025-10-14 17:40:06 us=3D422454 As IP address: 10.10.10.55 uint64 2025-10-14 17:49:28 us=3D407391 MANAGEMENT: CMD 'push-update-cid 0 "ifconfi= g 10.10.10.55 255.255.255.0"' 2025-10-14 17:49:28 us=3D407531 SENT CONTROL [client0]: 'PUSH_UPDATE,ifconf= ig 10.10.10.55 255.255.255.0' (status=3D1) 2025-10-14 17:49:28 us=3D407565 MULTI: Unlearn: 10.10.10.2 -> client0/udp6:= 92.168.3.1:37923 2025-10-14 17:49:28 us=3D407581 MULTI: Learn: 10.10.10.55 -> client0/udp6:9= 2.168.3.1:37923 2025-10-14 17:49:28 us=3D407592 New IPv4 Address Analysis: 2025-10-14 17:49:28 us=3D407600 Original s_addr: 0x370a0a0a =3D 92340= 4810 =3D 0000000000000000000000000000000000110111000010100000101000001010 2025-10-14 17:49:28 us=3D407606 ntohl(s_addr): 0x0a0a0a37 =3D 16843= 0135 =3D 0000000000000000000000000000000000001010000010100000101000110111 2025-10-14 17:49:28 us=3D407613 htonl(s_addr): 0x0a0a0a37 =3D 16843= 0135 =3D 0000000000000000000000000000000000001010000010100000101000110111 2025-10-14 17:49:28 us=3D407619 As IP address: 10.10.10.55 File src/openvpn/push_util.c: http://gerrit.openvpn.net/c/openvpn/+/1253/comment/bd5cee56_ee31112f?usp=3D= email : PS6, Line 165: o.ifconfig_local =3D canary; > in other parts of the code we use having a bool named like `$option_defin= ed` (in this case it would [=E2=80=A6] the canary is mostly to be less invasive as possible. I know it's a bit wei= rd but it works well and minimizes the scope for this logic without having = to touch other functions that are also used in other parts of the code in d= ifferent logic. Adding ifconfig_local_defined to the options struct and mod= ifying add_option() and remove_option(), just to handle -ifconfig(-ipv6) in= the server looks a little overkill to me. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1253?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: I07a8ddd9026eef64b6f5abde98702a9801616a5f Gerrit-Change-Number: 1253 Gerrit-PatchSet: 6 Gerrit-Owner: mrbff Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-CC: ordex Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-Comment-Date: Tue, 14 Oct 2025 16:05:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: ordex --0IkVHuUwGJQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: cron2, flichtenheld, ordex, plaisthos.

View = Change

2 comments:

  • File src/openvpn/multi.c:

    • Patch Set #5, = Line 4390: = mi->context.c2.push_ifconfig_local =3D htonl(new_addr.s_addr);

      something is weird here. [=E2=80=A6]

      yes I p= rinted bit by bit and they are the same and I don't understand why hton= l fixes things and I don't understand why (addr.s_addr =3D=3D htonl(add= .s_addr)) statement is false.

      uint32

      2025-10-14 17:40:06 us=3D42228= 5 MANAGEMENT: CMD 'push-update-cid 0 "ifconfig 10.10.10.55 255.255= .255.0"'
      2025-10-14 17:40:06 us=3D422386 SENT CONTROL [client0]= : 'PUSH_UPDATE,ifconfig 10.10.10.55 255.255.255.0' (status=3D1)
      = 2025-10-14 17:40:06 us=3D422409 MULTI: Unlearn: 10.10.10.2 -> client0/ud= p6:92.168.3.1:37467
      2025-10-14 17:40:06 us=3D422422 MULTI: Learn: 10.10.= 10.55 -> client0/udp6:92.168.3.1:37467


      2025-10-14 17:40:06 us=3D= 422432 New IPv4 Address Analysis:
      2025-10-14 17:40:06 us=3D422437 Orig= inal s_addr: 0x370a0a0a =3D 923404810 =3D 00110111000010100000101000001= 010
      2025-10-14 17:40:06 us=3D422442 ntohl(s_addr): 0x0a0a0a37 = =3D 168430135 =3D 00001010000010100000101000110111
      2025-10-14 17:40:06 u= s=3D422448 htonl(s_addr): 0x0a0a0a37 =3D 168430135 =3D 000010100000= 10100000101000110111
      2025-10-14 17:40:06 us=3D422454 As IP address: 10= .10.10.55

      uint64

      2025-10-14 17:49:28 us=3D407391 MANAGEMENT: CMD &#= 39;push-update-cid 0 "ifconfig 10.10.10.55 255.255.255.0"'2025-10-14 17:49:28 us=3D407531 SENT CONTROL [client0]: 'PUSH_UPDATE,i= fconfig 10.10.10.55 255.255.255.0' (status=3D1)
      2025-10-14 17:49:28 = us=3D407565 MULTI: Unlearn: 10.10.10.2 -> client0/udp6:92.168.3.1:37923<= br>2025-10-14 17:49:28 us=3D407581 MULTI: Learn: 10.10.10.55 -> client0/= udp6:92.168.3.1:37923


      2025-10-14 17:49:28 us=3D407592 New IPv4 Addr= ess Analysis:
      2025-10-14 17:49:28 us=3D407600 Original s_addr: 0x3= 70a0a0a =3D 923404810 =3D 0000000000000000000000000000000000110111000010100= 000101000001010
      2025-10-14 17:49:28 us=3D407606 ntohl(s_addr): 0= x0a0a0a37 =3D 168430135 =3D 00000000000000000000000000000000000010100000101= 00000101000110111
      2025-10-14 17:49:28 us=3D407613 htonl(s_addr): = 0x0a0a0a37 =3D 168430135 =3D 000000000000000000000000000000000000101000001= 0100000101000110111
      2025-10-14 17:49:28 us=3D407619 As IP address: 10.= 10.10.55

  • File src= /openvpn/push_util.c:

    • Patch Set #6, Line 165: o.ifconfig_local =3D canary;

      in = other parts of the code we use having a bool named like `$option_defined` (= in this case it would [=E2=80=A6]

      the canary is mostly to= be less invasive as possible. I know it's a bit weird but it works wel= l and minimizes the scope for this logic without having to touch other func= tions that are also used in other parts of the code in different logic. Add= ing ifconfig_local_defined to the options struct and modifying add_option()= and remove_option(), just to handle -ifconfig(-ipv6) in the server looks a= little overkill to me.

To view, visit change 1253. T= o unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I07a8ddd9026eef64b6f5abde987= 02a9801616a5f
Gerrit-Change-Number: 1253
Gerrit-PatchSet: 6
Gerrit-Owner: mrbff <marco@...2726...> <= /div>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-CC: ordex <antonio@...2726...>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <antonio@...2726...= >
Gerrit-Comment-Date: Tue, 14 Oct 2025 16:05:02= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: ordex <antonio@...2787...= ...>
= --0IkVHuUwGJQ=--