From: "its_Giaan (Code Review)" Date: Thu, 12 Dec 2024 09:42:51 +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: <78de764131ff5411ac031cd5e832a61791eb311b-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="s4jWLteat6E="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: allow user to specify 'local' multiple times in config files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cron2 , flichtenheld , plaisthos , openvpn-devel --s4jWLteat6E= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, ordex, plaisthos. its_Giaan has posted comments on this change. ( http://gerrit.openvpn.net/c= /openvpn/+/436?usp=3Demail ) Change subject: allow user to specify 'local' multiple times in config files ...................................................................... Patch Set 8: (9 comments) File doc/man-sections/link-options.rst: http://gerrit.openvpn.net/c/openvpn/+/436/comment/8dd8c81c_1c28df37 : PS7, Line 114: open a socket. > This text is not clear to me. What does "*" do? (This interacts with #7= 61 on `::`). [=E2=80=A6] Done, for the text. (--proto) It will not interact with --proto, I tried to avoid checking it as it is fi= shy on the server side since we may have multiple sockets of different prot= ocols, instead we will check the protocol for each socket when possible, ot= herwise we rely on the mode. File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/436/comment/3c4e7f07_331b4f56 : PS5, Line 6247: if (strcmp(p[1], "*") !=3D 0) > should we issue a warning if someone specifies "--local *" without port n= umber that this is a NOOP? Acknowledged File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/436/comment/d9af2a74_f67140b0 : PS7, Line 133: " a server listen on multiple soc= kets at the same time.\n" > when there is agreement on the wording in the manpage, this needs to be a= ddressed as well Done http://gerrit.openvpn.net/c/openvpn/+/436/comment/b04415ed_9d0e4ae8 : PS7, Line 998: setenv_str_i(es, "local", e->local_list->array[0]->local= , i); > will this crash if `--local` has not been used at all? No, it will not, even without specifying any '--local' we're gonna create a= local_entry based on the global port, see options.c:3818 for details. http://gerrit.openvpn.net/c/openvpn/+/436/comment/750168cd_967ca0a0 : PS7, Line 2406: } > I would not check on `ce->remote` but on `mode =3D=3D SERVER` here, and c= hange the wording to `multiple [=E2=80=A6] Done for the check. See answer above for --local crash question. http://gerrit.openvpn.net/c/openvpn/+/436/comment/fb946320_525f1ec3 : PS7, Line 3185: bool need_bind =3D ce->local_port_defined || ce->bind_d= efined; > this looks incomplete - shouldn't the existence of a `--local` entry also= set `need_bind =3D true`? Extended this with checking for the local_list, (if not NULL we're going to= bind). http://gerrit.openvpn.net/c/openvpn/+/436/comment/d52d560f_2dcb23ff : PS7, Line 3198: if (o->client && !need_bind) > is this intentional or a rebase artefact? This looks a bit unrelated Done http://gerrit.openvpn.net/c/openvpn/+/436/comment/6ecec3d0_fc5af621 : PS7, Line 3827: /* use the same listen list for every outgoing connecti= on */ > well... for outgoing connections we do not want to use a *list* at all, a= s we can only bind() once.. [=E2=80=A6] We handle everything as a list, but later on there's a specific sanity chec= k that in the case of clients ensures that the list has only one element. http://gerrit.openvpn.net/c/openvpn/+/436/comment/3a5e4b2a_9eed652f : PS7, Line 6250: e->bind_local =3D true; > I do not understand this `bind_local` variable. [=E2=80=A6] I removed the bind_local variable on the local_entry and rely on the o->ce.= bind_local which has all the sanity checks of the case. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/436?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: I4d1c96662c5a8c750d883e3b20adde09529e2764 Gerrit-Change-Number: 436 Gerrit-PatchSet: 8 Gerrit-Owner: ordex Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: its_Giaan Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-Comment-Date: Thu, 12 Dec 2024 09:42:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 Comment-In-Reply-To: flichtenheld Gerrit-MessageType: comment --s4jWLteat6E= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, flichtenheld, ordex, plais= thos.

View C= hange

9 comments:

    =
  • File doc/man-sections/link-options.= rst:

    • Patch Set #7, = Line 114: open a sock= et.

      This text is not clear to me. What does "*&= quot; do? (This interacts with #761 on `::`). [=E2=80=A6]

      =

      Done, for the te= xt.

      (--proto)=
      It will not interact with --proto, I tried to avoid checking it as it i= s fishy on the server side since we may have multiple sockets of different = protocols, instead we will check the protocol for each socket when possible= , otherwise we rely on the mode.

  • File src/openvpn/options.c:

    • Patch Set #5, Line 6247: if (strcmp(p[1], "*") !=3D 0)<= /code>

      should we issue a warning if someone specifies "= --local *" without port number that this is a NOOP?

      Acknowledged

  • File src/openvpn/optio= ns.c:

    • Patch Set #7,= Line 133: " = a server listen on multiple sockets at the same time.= \n"

      when there is agreement on the wording in th= e manpage, this needs to be addressed as well

      Done

    • Patch S= et #7, Line 998: se= tenv_str_i(es, "local", e->local_list->array[0]->local, = i);

      will this crash if `--local` has not been used at= all?

      No, it will not, even without specifying any '--local' we'= ;re gonna create a local_entry based on the global port, see options.c:3818= for details.

    • Patch Set #7, Line 2406: }

      I would not ch= eck on `ce->remote` but on `mode =3D=3D SERVER` here, and change the wor= ding to `multiple [=E2=80=A6]

      Done for the check.

      See answer above for --local crash qu= estion.

    • Patch Set #7, Line 3185: bool need_bind =3D ce->local_port_defined= || ce->bind_defined;

      this looks incomplete - shou= ldn't the existence of a `--local` entry also set `need_bind =3D true`?=

      Extended this with checking for the local_list, (if not NULL we're goi= ng to bind).

    • Patch Set #7, Line 3198: if (o->client && !need_bind)=

      is this intentional or a rebase artefact? This look= s a bit unrelated

      Done

    • Patch Set #7, Line 3827: /* use the same listen list f= or every outgoing connection */

      well... for outgoing = connections we do not want to use a *list* at all, as we can only bind() on= ce.. [=E2=80=A6]

      We handle everything as a list, but later on there's a= specific sanity check that in the case of clients ensures that the list ha= s only one element.

    • <= p style=3D"margin-bottom: 4px;">Patch Set #7, Line 6250: e->bind_local =3D tru= e;

      I do not understand this `bind_local` variable. [= =E2=80=A6]

      I removed the bind_local variable on the local_entry and rely on= the o->ce.bind_local which has all the sanity checks of the case.

To view, visit change 436. To unsubscribe, or for help writ= ing mail filters, visit sett= ings.

<= link itemprop=3D"url" href=3D"http://gerrit.openvpn.net/c/openvpn/+/436?usp= =3Demail"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4d1c96662c5a8c750d883e3b20a= dde09529e2764
Gerrit-Change-Number: 436
Gerrit-PatchSet: 8
Gerrit-Owner: ordex <a@...2181...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: its_Giaan <gianmarco@...1664...= 26...>
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: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <a@...2181...> <= /div>
Gerrit-Comment-Date: Thu, 12 Dec 2024 09:42:51= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <gert@...1296...= >
Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
Gerrit-MessageType: comment
--s4jWLteat6E=--