From: "cron2 (Code Review)" Date: Sun, 17 Aug 2025 16:24:32 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., marco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <10c44cd8ce1eda594aadaafa2eed04880e20f836-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="lG8b/lYFmjQ="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message sender: enabling the server to send PUSH_UPDATE c... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrbff Cc: flichtenheld , stipa , plaisthos , openvpn-devel --lG8b/lYFmjQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, mrbff, plaisthos, stipa. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/869?usp=3Demail ) Change subject: PUSH_UPDATE message sender: enabling the server to send PUS= H_UPDATE control messages ...................................................................... Patch Set 23: Code-Review-2 (2 comments) Patchset: PS23: There's two things that need fixing - one is a (trivial) rebase accident in= manage.c (and please check if there are more of them). The other is a lack of robustness on invalid pushed options on the server s= ide - that is, you do on the management interface ``` push-update-broad blab SUCCESS: 1 client(s) updated SUCCESS: push-update command succeeded ``` (so it claims "success") but what really happens is "the full server restar= ts" ``` Aug 17 18:11:40 gentoo tun-udp-p2mp[4243]: MANAGEMENT: CMD 'push-update-cid= 20 -dns' Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: MANAGEMENT: CMD 'push-update-bro= ad blab' Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: SENT CONTROL [cron2-freebsd-tc-a= md64]: 'PUSH_UPDATE,blab' (status=3D1) Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: Pushed option is not updatable: = 'blab'. Restarting. Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: Failed to process push update me= ssage sent to client ID: 0 Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Close Socket failed: Ba= d file descriptor (errno=3D9) Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: SIGUSR1[soft,Offending option re= ceived from server] received, process restarting Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: Restart pause, 1 second(s) ``` it should not do that, but give an error on the management interface instea= d. If pushing "correct" stuff it works, even if the timing is a bit odd server: ``` Aug 17 18:16:01 gentoo tun-udp-p2mp[4243]: MANAGEMENT: CMD 'push-update-bro= ad "route 10.204.0.0 255.255.240.0"' ``` client ``` 2025-08-17 18:16:12 PUSH: Received control message: 'PUSH_UPDATE,route 10.2= 04.0.0 255.255.240.0' ``` so it took 11 seconds for the message to actually get out (clocks are in sy= nc, and this is observable, so not a "clocks are wrong" artefact). There is something else that isn't right with pushing ifconfigs, but maybe = I am doing it wrong ``` push-update-cid 2 "ifconfig 10.204.2.46 10.204.2.45" SUCCESS: 1 client(s) updated ``` client does new ifconfig. Ping server gives ``` Aug 17 18:20:08 gentoo tun-udp-p2mp[4243]: cron2-freebsd-tc-amd64/udp6:194.= 97.140.21:14092 MULTI: bad source address from client [10.204.2.46], packet= dropped ``` so the client is using the correct source IP, but the server has not learne= d it. The server claims it has, though ``` Aug 17 18:19:54 gentoo tun-udp-p2mp[4243]: MULTI: Learn: 10.204.2.46/0 -> c= ron2-freebsd-tc-amd64/udp6:194.97.140.21:14092 ``` The /0 is a bit suspicious, for "regular" learning it prints ``` Aug 17 18:17:32 gentoo tun-udp-p2mp[4243]: MULTI: Learn: 10.204.2.6 -> cron= 2-freebsd-tc-amd64/udp6:194.97.140.21:14092 ``` For IPv6 it does not work either ``` Aug 17 18:23:37 gentoo tun-udp-p2mp[4243]: SENT CONTROL [cron2-freebsd-tc-a= md64]: 'PUSH_UPDATE,ifconfig-ipv6 fd00:abcd:204:2::9a9a/64 fd00:abcd:204:2:= :1' (status=3D1) Aug 17 18:23:37 gentoo tun-udp-p2mp[4243]: MULTI: Learn: ::/0 -> cron2-free= bsd-tc-amd64/udp6:194.97.140.21:14092 Aug 17 18:23:46 gentoo tun-udp-p2mp[4243]: cron2-freebsd-tc-amd64/udp6:194.= 97.140.21:14092 MULTI: bad source address from client [fd00:abcd:204:2::9a9= a], packet dropped ``` why ::/0 ?!? File src/openvpn/manage.c: http://gerrit.openvpn.net/c/openvpn/+/869/comment/9d6db2f0_20959fe8 : PS23, Line 136: msg(M_CLIENT, "version [n] : Set client's ve= rsion to n or show current version of daemon."); Unfortunately a rebase accident has happened here, and now this line is pri= nted twice. While trivial to correct, project rules require that I do not = do code-changes on merge. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/869?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie82bcc7a8e583de9156b185d71d1a323ed8df3fc Gerrit-Change-Number: 869 Gerrit-PatchSet: 23 Gerrit-Owner: mrbff Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: mrbff Gerrit-Attention: stipa Gerrit-Comment-Date: Sun, 17 Aug 2025 16:24:32 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --lG8b/lYFmjQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, mrbff, plaisthos, s= tipa.

Patch set 23:Code-Review -2

V= iew Change

2 comments:

  • Patchset:

    • Patch Set #23:

      There's two things that need fixing - o= ne is a (trivial) rebase accident in manage.c (and please check if there ar= e more of them).

      The other is a lack of robustness on invalid pushed options on the serv= er side - that is, you do on the management interface

      ```
      push-update-broad blab
      S= UCCESS: 1 client(s) updated
      SUCCESS: push-update command succeeded
      ``= `

      (so it clai= ms "success") but what really happens is "the full server re= starts"

      = ```
      Aug 17 18:11:40 gentoo tun-udp-p2mp[4243]: MANAGEMENT: CMD 'push= -update-cid 20 -dns'
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: MANA= GEMENT: CMD 'push-update-broad blab'
      Aug 17 18:11:46 gentoo tun-= udp-p2mp[4243]: SENT CONTROL [cron2-freebsd-tc-amd64]: 'PUSH_UPDATE,bla= b' (status=3D1)
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: Pushed op= tion is not updatable: 'blab'. Restarting.
      Aug 17 18:11:46 gento= o tun-udp-p2mp[4243]: Failed to process push update message sent to client = ID: 0
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closing socket=
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Close Socket failed= : Bad file descriptor (errno=3D9)
      Aug 17 18:11:46 gentoo tun-udp-p2mp[42= 43]: TCP/UDP: Closing socket
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: = TCP/UDP: Closing socket
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/U= DP: Closing socket
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: C= losing socket
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: TCP/UDP: Closin= g socket
      Aug 17 18:11:46 gentoo tun-udp-p2mp[4243]: SIGUSR1[soft,Offendi= ng option received from server] received, process restarting
      Aug 17 18:1= 1:46 gentoo tun-udp-p2mp[4243]: Restart pause, 1 second(s)
      ```

      it should not do that,= but give an error on the management interface instead.

      If pushing "correct" s= tuff it works, even if the timing is a bit odd

      server:
      ```
      Aug 17 18:16:01 gentoo = tun-udp-p2mp[4243]: MANAGEMENT: CMD 'push-update-broad "route 10.2= 04.0.0 255.255.240.0"'
      ```

      client

      ```
      2025-08-17 18:16:12 PUSH: Received control messa= ge: 'PUSH_UPDATE,route 10.204.0.0 255.255.240.0'
      ```

      so it took 11 seconds fo= r the message to actually get out (clocks are in sync, and this is observab= le, so not a "clocks are wrong" artefact).


      There is something else that is= n't right with pushing ifconfigs, but maybe I am doing it wrong

      ```
      push-update-c= id 2 "ifconfig 10.204.2.46 10.204.2.45"
      SUCCESS: 1 client(s) u= pdated
      ```

      client does new ifconfig. Ping server gives

      ```
      Aug 17 18:20:08 gentoo tun-udp-p2mp= [4243]: cron2-freebsd-tc-amd64/udp6:194.97.140.21:14092 MULTI: bad source a= ddress from client [10.204.2.46], packet dropped
      ```

      so the client is using the corre= ct source IP, but the server has not learned it.

      The server claims it has, though

      ```
      Aug 17 18:19= :54 gentoo tun-udp-p2mp[4243]: MULTI: Learn: 10.204.2.46/0 -> cron2-free= bsd-tc-amd64/udp6:194.97.140.21:14092
      ```

      The /0 is a bit suspicious, for "regul= ar" learning it prints

      ```
      Aug 17 18:17:32 gentoo tun-udp-p2mp[4243]: MULTI: Lea= rn: 10.204.2.6 -> cron2-freebsd-tc-amd64/udp6:194.97.140.21:14092
      ```=

      For IPv6 it = does not work either

      ```
      Aug 17 18:23:37 gentoo tun-udp-p2mp[4243]: SENT CONTROL [cro= n2-freebsd-tc-amd64]: 'PUSH_UPDATE,ifconfig-ipv6 fd00:abcd:204:2::9a9a/= 64 fd00:abcd:204:2::1' (status=3D1)
      Aug 17 18:23:37 gentoo tun-udp-p= 2mp[4243]: MULTI: Learn: ::/0 -> cron2-freebsd-tc-amd64/udp6:194.97.140.= 21:14092
      Aug 17 18:23:46 gentoo tun-udp-p2mp[4243]: cron2-freebsd-tc-amd= 64/udp6:194.97.140.21:14092 MULTI: bad source address from client [fd00:abc= d:204:2::9a9a], packet dropped
      ```

      why ::/0 ?!?

  • File src/openvpn/manage.c:

    • Patch Set #23, Line 136: msg(M_CLIENT, "version [n] = : Set client's version to n or show current version of daemon."= ;);

      Un= fortunately a rebase accident has happened here, and now this line is print= ed twice. While trivial to correct, project rules require that I do not do= code-changes on merge.

To view, visit change 869. To = unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie82bcc7a8e583de9156b185d71d= 1a323ed8df3fc
Gerrit-Change-Number: 869
Gerrit-PatchSet: 23
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-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: mrbff <marco@...2726...&g= t;
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-Comment-Date: Sun, 17 Aug 2025 16:24:32= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--lG8b/lYFmjQ=--