From: "its_Giaan (Code Review)" Date: Fri, 14 Feb 2025 17:45:31 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296..., a@...2181... Message-ID: <59f4e29e841451bd764de3f10b435bcb06cbe0b9-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="rL3YTsmzmGM="; 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: , Cc: cron2 , flichtenheld , plaisthos , openvpn-devel --rL3YTsmzmGM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, ordex, plaisthos. its_Giaan has posted comments on this change. ( http://gerrit.openvpn.net/c= /openvpn/+/764?usp=3Demail ) Change subject: Add support for simultaneous use of UDP and TCP sockets ...................................................................... Patch Set 18: (15 comments) File src/openvpn/forward.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/50e5e827_606d6e4d : PS18, Line 2077: if (flags & IOW_WAIT_SIGNAL) > this is duplicating a huge chunk of code from `io_wait_dowork()` - which = is hard enough to read, wit [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/d0b6ff1d_733c10fb : PS18, Line 2184: if (c->c2.fast_io && (flags & (IOW_TO_TUN | IOW_TO_LIN= K | IOW_MBUF))) > this function is mostly identical to `forward. [=E2=80=A6] The multi_io has no event_set_status member and since UDP require that I de= cided to call it udp_flags since it is UDP specific. File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/f536d12b_7a5c51e7 : PS17, Line 2846: if (has_udp_in_local_list(&c->options)) > Well, this is introducing new code, to model behaviour that was not inten= tional in the first place. [=E2=80=A6] Done File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/29430a8c_d3861afa : PS18, Line 2685: if (!proto_is_udp(c->c2.link_sockets[0]->info.prot= o) > maybe add a de-confusing comment like `/* client side =3D only one link_s= ocket */` or so... [=E2=80=A6] Done File src/openvpn/multi.h: http://gerrit.openvpn.net/c/openvpn/+/764/comment/cad1ca81_6565d700 : PS18, Line 670: > how can this ever be called without valid `mi`? Shouldn't this be flagge= d as a hard error, like kee [=E2=80=A6] Done File src/openvpn/multi.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/6aa7274d_985a29c2 : PS18, Line 609: bool is_dgram =3D proto_is_dgram(mi->context.c2.link_so= ckets[0]->info.proto); > Is this for a (single-socket) client instance? Again we have a confused = reader wondering why we onl [=E2=80=A6] It is, the 'mi' tells you that this is a client-instance context. http://gerrit.openvpn.net/c/openvpn/+/764/comment/61d7a697_54c1c90d : PS18, Line 3841: if (!mi->halt && proto_is_dgram(mi->context.option= s.ce.proto)) > why is this using `mi->context.options.ce. [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/02b15a25_8acde395 : PS18, Line 3879: else if (has_udp_in_local_list(&m->top.options)) > why are you splitting this condition into two nested `if()`? I can see c= hanging `proto_is_dgram()` [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/0f048603_319d08a4 : PS18, Line 4164: * Main event loop for OpenVPN in multi-protocol server mo= de. > I'd remove the "multi-protocol" part (protocols, again) - maybe name this= `point-to-multipoint serve [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/20464f08_18d9e039 : PS18, Line 4169: void > static? Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/d0311291_8207b195 : PS18, Line 4265: } > I don't like this construct - now `tunnel_server_init()` is doing all the= work (init, call loop, uni [=E2=80=A6] Done File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/cef8e785_9aa6185f : PS18, Line 3351: if (!le->proto) > we have a comment for setting "port" and none for "proto". [=E2=80=A6] Acknowledged http://gerrit.openvpn.net/c/openvpn/+/764/comment/c5c0f206_666146e4 : PS18, Line 3816: } > this extra loop looks like it really wants to be part of `options_postpro= cess_mutate_le()`, no? Acknowledged http://gerrit.openvpn.net/c/openvpn/+/764/comment/611fa1ff_cab4dcb3 : PS18, Line 3839: > I'm actually not sure I understand `fast_io` well enough for this, but - = what I understand, `fast_io [=E2=80=A6] Acknowledged File src/openvpn/socket.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/68eeaf4b_34101cc0 : PS18, Line 1914: ASSERT(c->c2.link_sockets[sock_index]); > we already have an `ASSERT(sock)` at the beginning, which is `sock =3D c-= >c2. [=E2=80=A6] Done -- 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: 18 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-CC: ordex Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: ordex Gerrit-Comment-Date: Fri, 14 Feb 2025 17:45:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 Comment-In-Reply-To: ordex Gerrit-MessageType: comment --rL3YTsmzmGM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, ordex, plaisthos.

View C= hange

15 comments:

  • File src/openvpn/forward.c:

  • Patch Set #18, Line 2077:= if (flags & IO= W_WAIT_SIGNAL)

    this is duplicating a huge chunk of co= de from `io_wait_dowork()` - which is hard enough to read, wit [=E2=80=A6]<= /blockquote>

    = Done

  • Patch Set #18, Line 2184: if (c->c2.fast_io && (flags & (= IOW_TO_TUN | IOW_TO_LINK | IOW_MBUF)))

    this function = is mostly identical to `forward. [=E2=80=A6]

    The multi_io has no event_set_= status member and since UDP require that I decided to call it udp_flags sin= ce it is UDP specific.

  • File src/openvpn/init.c:

    • Patch Set #17, Line 2846: if (has_udp_in_local_list(&c->options))

      Well, this is introducing new code, to model behaviour= that was not intentional in the first place. [=E2=80=A6]

      <= p style=3D"white-space: pre-wrap; word-wrap: break-word;">Done

    • File src/openvpn/init.c:

      <= ul style=3D"list-style: none; padding: 0;">
    • Patch Set #18, Line 268= 5: if (!proto_i= s_udp(c->c2.link_sockets[0]->info.proto)

      maybe = add a de-confusing comment like `/* client side =3D only one link_socket */= ` or so... [=E2=80=A6]

      Done

  • File src/openvpn/multi.h:

    • Patch Set #18, Line 670:

      how can this ever be called with= out valid `mi`? Shouldn't this be flagged as a hard error, like kee [= =E2=80=A6]

      Done

  • F= ile src/openvpn/multi.c:

      Patch Set #18, Line 609: bool is_dgram =3D proto_is_dgram(mi->context.c2.link_sockets= [0]->info.proto);

      Is this for a (single-socket) cl= ient instance? Again we have a confused reader wondering why we onl [=E2= =80=A6]

      It is, the 'mi' tells you that this is a client-instance co= ntext.

    • Patch Set #18, Line 3841: if (!mi->halt && proto_is_dgr= am(mi->context.options.ce.proto))

      why is this usin= g `mi->context.options.ce. [=E2=80=A6]

      Done

    • Patch Set #= 18, Line 3879: else= if (has_udp_in_local_list(&m->top.options))

      w= hy are you splitting this condition into two nested `if()`? I can see chan= ging `proto_is_dgram()` [=E2=80=A6]

      Done

    • Patch Set #18, L= ine 4164: * Main event= loop for OpenVPN in multi-protocol server mode.

      I= 9;d remove the "multi-protocol" part (protocols, again) - maybe n= ame this `point-to-multipoint serve [=E2=80=A6]

      Done

    • Patch= Set #18, Line 4169: vo= id

      static?

      Done

    • Patch Set #18, Line = 4265: }

      I don't like this construct - now `tunnel_server_init()` is doin= g all the work (init, call loop, uni [=E2=80=A6]

      Done

  • <= li style=3D"margin: 0; padding: 0;">

    File src/openvpn/options.c:

  • File src= /openvpn/socket.c:

    • = Patch Set #18, Line 1914: ASSERT(c->c2.link_sockets[sock_index]);

      we = already have an `ASSERT(sock)` at the beginning, which is `sock =3D c->c= 2. [=E2=80=A6]

      Done

  • To view, visit change 764. To unsu= bscribe, 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: 18
    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-CC: ordex <a@...2181...>
    Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
    Gerrit-Attention: cron2 <gert@...1296...>= ;
    Gerrit-Attention: ordex <a@...2181...> <= /div>
    Gerrit-Comment-Date: Fri, 14 Feb 2025 17:45:31= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: cron2 <gert@...1296...= >
    Comment-In-Reply-To: ordex <a@...2181...>= ;
    Gerrit-MessageType: comment
    --rL3YTsmzmGM=--