From: "cron2 (Code Review)" Date: Wed, 27 Nov 2024 18:19:55 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ycbWzoPaBiE="; 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: , To: its_Giaan Cc: flichtenheld , plaisthos , openvpn-devel --ycbWzoPaBiE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, its_Giaan, ordex, plais= thos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/436?usp=3Demail ) Change subject: allow user to specify 'local' multiple times in config files ...................................................................... Patch Set 7: Code-Review-1 (9 comments) Patchset: PS7: This is messier than it should be - having the `local` list in the CE struc= ture, while it is only useful for servers (that do not use CE). But maybe = this cannot be fixed if we do want to permit a (single) `local` entry insid= e a `` (which makes sense). But besides this, there's questions... File doc/man-sections/link-options.rst: http://gerrit.openvpn.net/c/openvpn/+/436/comment/2ee16be6_972b5621 : PS7, Line 114: open a socket. This text is not clear to me. What does "*" do? (This interacts with #761= on `::`). Maybe: ``` On a client, or in point-to-point mode, this can only be specified once (1 = socket). On an OpenVPN setup running as `--server`, this can be specified = multiple times to open multiple listening sockets on different addresses an= d/or different ports. In order to specify multiple listen ports without specifying an address, us= e '*' to signal "use what the operating system gives you as default". For = "all IPv4 addresses" use '0.0.0.0', for "all IPv6 addresses" use '::'. `--local` implies `--bind`. ``` (It's also slightly unclear how this interacts with `--proto`? Maybe this = is added in a later patch of the series?) File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/436/comment/c96e1fb3_88b2e29c : 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 add= ressed as well http://gerrit.openvpn.net/c/openvpn/+/436/comment/1ff60b54_20cb34b1 : 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? http://gerrit.openvpn.net/c/openvpn/+/436/comment/24119bb9_af8f4bf9 : PS7, Line 2406: } I would not check on `ce->remote` but on `mode =3D=3D SERVER` here, and cha= nge the wording to `multiple --local statements only allowed in --server mo= de`. Also, will this crash if no `--local` statement has been used (aka is the l= ist always initialized?) http://gerrit.openvpn.net/c/openvpn/+/436/comment/8fdc0098_59259f5f : 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 s= et `need_bind =3D true`? http://gerrit.openvpn.net/c/openvpn/+/436/comment/f467c398_a6c43f2d : PS7, Line 3198: if (o->client && !need_bind) is this intentional or a rebase artefact? This looks a bit unrelated http://gerrit.openvpn.net/c/openvpn/+/436/comment/18bf97b8_6adc2bc6 : 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, as = we can only bind() once...? (but I need to read up on o->ce vs. o->connect= ion_list) http://gerrit.openvpn.net/c/openvpn/+/436/comment/42fa7611_2d03d61e : PS7, Line 6250: e->bind_local =3D true; I do not understand this `bind_local` variable. Of course we bind(), other= wise the whole setting of `local` does not make sense? And even on "*" we= do want to `bind()`...? -- 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: 7 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: its_Giaan Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-Comment-Date: Wed, 27 Nov 2024 18:19:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --ycbWzoPaBiE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, its_Giaan, ordex, p= laisthos.

Patch set 7:Code-Review -1=

Vi= ew Change

9 comments:

  • Patchset:

    • Patch Set #7:

      This is messier than it should be - having th= e `local` list in the CE structure, while it is only useful for servers (th= at do not use CE). But maybe this cannot be fixed if we do want to permit = a (single) `local` entry inside a `<connection>` (which makes sense).=

      But besides = this, there's questions...

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

    • Patch Set #7, Line 114: open a socket.

      This text is not clear to m= e. What does "*" do? (This interacts with #761 on `::`).

      Maybe:

      ```
      On a client, or i= n point-to-point mode, this can only be specified once (1 socket). On an O= penVPN setup running as `--server`, this can be specified multiple times to= open multiple listening sockets on different addresses and/or different po= rts.

      In order= to specify multiple listen ports without specifying an address, use '*= ' to signal "use what the operating system gives you as default&qu= ot;. For "all IPv4 addresses" use '0.0.0.0', for "a= ll IPv6 addresses" use '::'.

      `--local` implies `--bind`.
      ```

      (It's also slightly = unclear how this interacts with `--proto`? Maybe this is added in a later = patch of the series?)

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

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

  • Patch Set #7,= Line 998: setenv_s= tr_i(es, "local", e->local_list->array[0]->local, i);

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

  • Patch Set #= 7, Line 2406: }

    I would n= ot check on `ce->remote` but on `mode =3D=3D SERVER` here, and change th= e wording to `multiple --local statements only allowed in --server mode`.

    Also, will thi= s crash if no `--local` statement has been used (aka is the list always ini= tialized?)

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

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

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

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

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

    well... for outgoing connections we do not= want to use a *list* at all, as we can only bind() once...? (but I need t= o read up on o->ce vs. o->connection_list)

  • Patch Set= #7, Line 6250: = e->bind_local =3D true;

    I do not understand this `bind_local` variable. = Of course we bind(), otherwise the whole setting of `local` does not make s= ense? And even on "*" we do want to `bind()`...?

<= /li>

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4d1c96662c5a8c750d883e3b20a= dde09529e2764
Gerrit-Change-Number: 436
Gerrit-PatchSet: 7
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: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <a@...2181...> <= /div>
Gerrit-Comment-Date: Wed, 27 Nov 2024 18:19:55= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--ycbWzoPaBiE=--