From: "cron2 (Code Review)" Date: Fri, 24 Jan 2025 21:50:41 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="c5PjzBmBtbI="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: Add support for simultaneous use of UDP and TCP sockets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan Cc: flichtenheld , plaisthos , openvpn-devel --c5PjzBmBtbI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: its_Giaan, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/764?usp=3Demail ) Change subject: Add support for simultaneous use of UDP and TCP sockets ...................................................................... Patch Set 17: (12 comments) Patchset: PS17: more comments File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/e1ebc360_490d6327 : PS17, Line 3834: this (and the next) blank line are arguably good, and should be kept, no? http://gerrit.openvpn.net/c/openvpn/+/764/comment/8b76c90d_17966fbf : PS17, Line 228: if (ce->proto !=3D PROTO_TCP && c->mode !=3D CM= _CHILD_TCP) what's the reason for this change? the conditions should be the same? http://gerrit.openvpn.net/c/openvpn/+/764/comment/9a35e34d_80fa4240 : PS17, Line 616: c->options.ce.proto =3D proto; this does not look right. So we advance to the next ce, but keep the proto= ? Wouldn't that break ``` remote ... udp remote ... tcp ``` setups? http://gerrit.openvpn.net/c/openvpn/+/764/comment/d8380160_cf33bdd0 : PS17, Line 2687: if (!proto_is_udp(c->c2.link_sockets[0]->info.prot= o) && c->options.ce.explicit_exit_notification) this like is getting a bit long, so I think wrapping might be a good thing http://gerrit.openvpn.net/c/openvpn/+/764/comment/e84b95dc_73633f8a : PS17, Line 2846: if (has_udp_in_local_list(&c->options)) this might be modelling the existing behaviour, but it's arguable whether t= he old behaviour was actually correct - a *server* should not do exponentia= l backoff after a connection failure, no matter whether TCP or UDP. http://gerrit.openvpn.net/c/openvpn/+/764/comment/ff1ffcf7_a5d0582f : PS17, Line 3369: } given that `link_socket_proto_connection_oriented()` (nowadays) is a very l= ong form of `if (!proto_is_dgram())` I don't think it makes sense to have t= he code this way - get rid of the `if()`, loop always. That said, grepping through the code, `to.tcp_mode` seems to be dead anyway= - I see no user of it. Get rid of it completely, then ;-) File src/openvpn/mroute.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/e768a558_8ea1565c : PS17, Line 424: buf_printf(&out, ":%d", maddr.proto); we should not unconditionally add this `:%d`. It might be useful, but when= MR_WITH_PORT is not set, it very much looks like `:6` or `:17` being the r= emote port. If we really want this, we should ascii-ize the proto and prepend (`tcp:1.2= .3.4:1194`), no? File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/cf0b5a07_5892252f : PS17, Line 1052: setenv_local_entry(es, o->ce.local_list->array= [i], i+1); you have an i+1 here, and another i+1 inside `setenv_local_entry()`... what= is it that you want to achieve here? http://gerrit.openvpn.net/c/openvpn/+/764/comment/2b3f667b_e3b3e51c : PS17, Line 3192: o->ce.proto =3D ce->proto; what is `o->ce.proto`? http://gerrit.openvpn.net/c/openvpn/+/764/comment/1bf199d4_7737bca5 : PS17, Line 3198: if (ce->local_list->array[i]->proto =3D=3D= PROTO_TCP) So we walk the list here, for the `--server` case, and then walk it again i= n `option_postprocess_mutate()` for all cases, correct? So we could just s= tore the desired proto (TCP_SERVER etc) in `o->ce.proto` here and leave the= walking the list to `option_postprocess_mutate()`? http://gerrit.openvpn.net/c/openvpn/+/764/comment/4ee90666_8e61c48d : PS17, Line 3838: msg(M_INFO, "NOTE: --fast-io is disabled while usi= ng multi-socket"); that comment needs to be something like `--fast-ip is disabled if there is = a TCP socket active` or so ("using multi-socket" with multiple UDP sockets = won't be a problem) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/764?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: I31bbf87e4e568021445c7512ecefadfd4a69b363 Gerrit-Change-Number: 764 Gerrit-PatchSet: 17 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: its_Giaan Gerrit-Comment-Date: Fri, 24 Jan 2025 21:50:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment --c5PjzBmBtbI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: its_Giaan, plaisthos.

View C= hange

12 comments:

  • Patchset:

  • File src/openvpn/init.c:

    • Patch Set #17, Line 3834:

      this (and the next) blank line are arguably go= od, and should be kept, no?

    • Patch Set #17, Line 228: <= code style=3D"font-family:monospace,monospace"> if (ce->proto= !=3D PROTO_TCP && c->mode !=3D CM_CHILD_TCP)

      what's the reason fo= r this change? the conditions should be the same?

    • Patch S= et #17, Line 616: = c->options.ce.proto =3D proto;

      this does not look right. So we advance to = the next ce, but keep the proto? Wouldn't that break

      ```
      <connec= tion>
      remote ... udp
      <connection>
      remote ... tcp
      `= ``

      setups?<= /p>

    • Patch Set #17, Line 2687: if (!proto_is_udp(c->c2.link_sockets[0]->= info.proto) && c->options.ce.explicit_exit_notification)<= /p>

      this like is = getting a bit long, so I think wrapping might be a good thing

    • <= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/764/comment/e84b95dc_73633f= 8a">Patch Set #17, Line 2846: if (has_udp_in_local_list(&c->options))

      this might be m= odelling the existing behaviour, but it's arguable whether the old beha= viour was actually correct - a *server* should not do exponential backoff a= fter a connection failure, no matter whether TCP or UDP.

    • = Patch Set #17, Line 3369: }

      given that `link_socket_proto_connection_oriented()` (nowadays) is a ver= y long form of `if (!proto_is_dgram())` I don't think it makes sense to= have the code this way - get rid of the `if()`, loop always.

      That said, grepping thro= ugh the code, `to.tcp_mode` seems to be dead anyway - I see no user of it. = Get rid of it completely, then ;-)

  • File src/openvpn/mroute.c:

    • Patch Set #17, Line 424: buf_printf(&out, ":%d= ", maddr.proto);

      we should not unconditionally add this `:%d`. It might be = useful, but when MR_WITH_PORT is not set, it very much looks like `:6` or `= :17` being the remote port.

      If we really want this, we should ascii-ize the proto and pr= epend (`tcp:1.2.3.4:1194`), no?

  • File src/openvpn/options.c:

    • Patch Set #17, Line 1052: setenv_local_entry(es, o->ce.loca= l_list->array[i], i+1);

      you have an i+1 here, and another i+1 inside `setenv_l= ocal_entry()`... what is it that you want to achieve here?

    • Patch Set #17, Line 3192: o->ce.proto =3D ce->proto;

      what is `o->ce.proto`?

    • Patch Set #17, Line 3198: if (ce->local_list->array[i]->proto = =3D=3D PROTO_TCP)

      So we walk the list here, for the `--server` case, and then wal= k it again in `option_postprocess_mutate()` for all cases, correct? So we = could just store the desired proto (TCP_SERVER etc) in `o->ce.proto` her= e and leave the walking the list to `option_postprocess_mutate()`?

    • =
    • Patch Set #17, Line 3838: msg(M_INFO, "NOTE: --fast-io is disabled while usi= ng multi-socket");

      that comment needs to be something like `--fast-ip is dis= abled if there is a TCP socket active` or so ("using multi-socket"= ; with multiple UDP sockets won't be a problem)

=

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I31bbf87e4e568021445c7512ece= fadfd4a69b363
Gerrit-Change-Number: 764
Gerrit-PatchSet: 17
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
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-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Comment-Date: Fri, 24 Jan 2025 21:50:41= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
--c5PjzBmBtbI=--