From: "cron2 (Code Review)" Date: Wed, 19 Jun 2024 09:13:14 +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="AVvN+MoOISc="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Route: add support for user defined routing table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan Cc: flichtenheld , plaisthos , openvpn-devel --AVvN+MoOISc= 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/+/524?usp=3Demail ) Change subject: Route: add support for user defined routing table ...................................................................... Patch Set 4: Code-Review-1 (1 comment) Patchset: PS4: Sorry for being late to the party - I have looked at it, and while the gene= ral code works, I find it a bit excessive in lines of code. Namely, I woul= d opt for "do not support route-table as an extra argument to `route`", as = this + the checks really makes up half the code - for little value. Since = it's not supposed to be pushable, routes-with-table need to be in the clien= t config, and in that case, I could just put ``` route-table 123 route route route-table 456 route route route-table 999 # for everything that comes in pushed ``` into my config. If I ever really need more than 1-2 route tables. Also, we shouldn't have `#ifdef ENABLE_SITNL` in the parser for `route` and= `route-ipv6`... Further, the hunk ``` + int table_id =3D 0; /* unspec table */ ... + if (options->route_default_table_id) + { + table_id =3D options->route_default_table_id; + } ``` is sort of semi-useful - if route_default_table_id is 0, we do not assign i= t to table_id, which is also 0. Why bother with an extra variable here tha= t will have the same value as the `options` variable, at all times? I'd ju= st pass `options->route_default_table_id` downwards, and be done with it. The `do_init_route_ipv6_list()` code also does the `table_id =3D ...` dance= , but then passes NULL towards `add_route_ipv6_to_option_list()`, which doe= s not look intentional... -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/524?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: I3e4ebef484d2a04a383a65ede5617ee98bf218a7 Gerrit-Change-Number: 524 Gerrit-PatchSet: 4 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: Wed, 19 Jun 2024 09:13:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --AVvN+MoOISc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: its_Giaan, plaisthos.

Patch set 4:Code-Review -1=

Vi= ew Change

1 comment:

  • Patchset:

    • Patch Set #4:

      Sorry for being late to the party - I have loo= ked at it, and while the general code works, I find it a bit excessive in l= ines of code. Namely, I would opt for "do not support route-table as = an extra argument to `route`", as this + the checks really makes up ha= lf the code - for little value. Since it's not supposed to be pushable= , routes-with-table need to be in the client config, and in that case, I co= uld just put

      = ```
      route-table 123
      route
      route
      route-table 456
      route
      rou= te
      route-table 999
      # for everything that comes in pushed
      ```

      into my config. I= f I ever really need more than 1-2 route tables.

      Also, we shouldn't have `#ifdef ENA= BLE_SITNL` in the parser for `route` and `route-ipv6`...

      Further, the hunk

      ```
      + int table_id= =3D 0; /* unspec table */
      ...
      + if (options->route_default_tab= le_id)
      + {
      + table_id =3D options->route_default_table_i= d;
      + }
      ```

      is sort of semi-useful - if route_default_table_id is 0, we do not a= ssign it to table_id, which is also 0. Why bother with an extra variable h= ere that will have the same value as the `options` variable, at all times? = I'd just pass `options->route_default_table_id` downwards, and be d= one with it.

      = The `do_init_route_ipv6_list()` code also does the `table_id =3D ...` dance= , but then passes NULL towards `add_route_ipv6_to_option_list()`, which doe= s not look intentional...

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I3e4ebef484d2a04a383a65ede56= 17ee98bf218a7
Gerrit-Change-Number: 524
Gerrit-PatchSet: 4
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: Wed, 19 Jun 2024 09:13:14= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--AVvN+MoOISc=--