From: "its_Giaan (Code Review)" Date: Fri, 31 Jan 2025 10:42:34 +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: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="BWMQsC4RyYc="; 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 --BWMQsC4RyYc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, 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 17: (13 comments) File src/openvpn/forward.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/d2d2bf21_d4657dec : PS17, Line 2471: > spurious new line Done File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/557e83eb_4b361d4d : PS17, Line 3834: > this (and the next) blank line are arguably good, and should be kept, no? Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/e3883fac_7a141a70 : 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? Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/098aad10_d6ea2c6c : PS17, Line 616: c->options.ce.proto =3D proto; > this does not look right. So we advance to the next ce, but keep the pro= to? Wouldn't that break [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/d2412021_82123c38 : 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 Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/d9a8ec74_c1f662c7 : PS17, Line 3369: } > given that `link_socket_proto_connection_oriented()` (nowadays) is a very= long form of `if (!proto_i [=E2=80=A6] Done File src/openvpn/mroute.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/8b5bd492_5d35e8a3 : PS17, Line 424: buf_printf(&out, ":%d", maddr.proto); > we should not unconditionally add this `:%d`. [=E2=80=A6] Done File src/openvpn/mtcp.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/e4035612_308aec8e : PS17, Line 57: if (mi && !proto_is_dgram(ls->info.proto)) > why would this be called for an UDP packet in the first place, that is, w= hy is that check necessary? that's a leftover from early development when still trying to untangle udp = and tcp clients. http://gerrit.openvpn.net/c/openvpn/+/764/comment/74a66627_6f73d597 : PS17, Line 156: if (proto_is_dgram(mi->context.c2.link_sockets[0]->= info.proto)) > same here: why is this check necessary? Who calls a `_tcp_` function for= UDP packets, and why? see answer above File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/764/comment/f9770527_5f1c061a : 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()`... [= =E2=80=A6] i'm not sure either http://gerrit.openvpn.net/c/openvpn/+/764/comment/bb8e11ad_17fcd75d : PS17, Line 3192: o->ce.proto =3D ce->proto; > what is `o->ce. [=E2=80=A6] o->ce differs from let's say o->connection_list->array[0] but this is not a= big deal on server side while it can be dangerous on client side so a copy= won't hurt. http://gerrit.openvpn.net/c/openvpn/+/764/comment/efef2d42_e743e796 : 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= in `option_postprocess_mut [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/764/comment/809120a8_8e4a8ed5 : 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 i= s a TCP socket active` or s [=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: 17 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-Comment-Date: Fri, 31 Jan 2025 10:42:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 Gerrit-MessageType: comment --BWMQsC4RyYc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, plaisthos.

View C= hange

13 comments:

  • File src/openvpn/init.c:

    • Patch Set #17, Line 3834:

      this (and the next) blank line are a= rguably good, and should be kept, no?

      Done

    • Patch Set #17, = Line 228: i= f (ce->proto !=3D PROTO_TCP && c->mode !=3D CM_CHILD_TCP)

      what's the reason for this change? the conditions s= hould be the same?

      Done

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

      this does not look right. So we advance t= o the next ce, but keep the proto? Wouldn't that break [=E2=80=A6]

      Don= e

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

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

      Done

    • Patch Set #17, Line 3369: }

      given= that `link_socket_proto_connection_oriented()` (nowadays) is a very long f= orm of `if (!proto_i [=E2=80=A6]

      Done

  • File src/openvpn/mroute.c:

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

      we should not unconditionall= y add this `:%d`. [=E2=80=A6]

      Done

  • File src/openvpn/mtcp.c:

    • Patch Set #17, Line 57: if (mi && !proto_is_dgram(ls->info.= proto))

      why would this be called for an UDP packet in= the first place, that is, why is that check necessary?

      that's a leftov= er from early development when still trying to untangle udp and tcp clients= .

    • Patch Set #17, Line 156: if (proto_is_dgram(mi->context.c2.link_sock= ets[0]->info.proto))

      same here: why is this check = necessary? Who calls a `_tcp_` function for UDP packets, and why?

      see answ= er above

  • File src= /openvpn/options.c:

    • Patch Set #17, 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 `set= env_local_entry()`... [=E2=80=A6]

      i'm not sure either

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

      what = is `o->ce. [=E2=80=A6]

      o->ce differs from let's say o->connect= ion_list->array[0] but this is not a big deal on server side while it ca= n be dangerous on client side so a copy won't hurt.

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

      So we walk the list here, for the `--server` c= ase, and then walk it again in `option_postprocess_mut [=E2=80=A6]

      Done

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

      that comment needs to be= something like `--fast-ip is disabled if there is a TCP socket active` or = s [=E2=80=A6]

      Done

  • To view, visit change 764. To unsub= scribe, 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-CC: ordex <a@...2181...>
    Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
    Gerrit-Attention: cron2 <gert@...1296...>= ;
    Gerrit-Comment-Date: Fri, 31 Jan 2025 10:42:34= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: cron2 <gert@...1296...= >
    Gerrit-MessageType: comment
    --BWMQsC4RyYc=--