From: "cron2 (Code Review)" Date: Wed, 25 Sep 2024 15:10:41 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <94253c21aedf6f121861a2af91d994fe98bbcfdb-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="QHVV6n8vlGI="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Remove null check after checking for checking for did_open_tun List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --QHVV6n8vlGI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/772?usp=3Demail ) Change subject: Remove null check after checking for checking for did_open_= tun ...................................................................... Patch Set 1: Code-Review+2 (1 comment) Patchset: PS1: Indeed, this patch makes sense - if it would be NULL, the check is too late= , so in this place it does not add anything useful. After staring at the code for quite some time I am reasonably convinced tha= t c2.did_open_tun will only be set if `do_open_tun()` was called, which wil= l either have a previously-set tuntap or will allocate a new one in `do_ini= t_tun()`. `do_close_tun()` seems to be the only code path that could set `tuntap =3D = NULL` (and it does not clear `did_open_tun`), but it is only called in sequ= ences where it's either reopened right away, or where the instance ends for= good. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/772?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: I9966636163c7dfa208d26f1cadbf5b81937f3a34 Gerrit-Change-Number: 772 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Wed, 25 Sep 2024 15:10:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --QHVV6n8vlGI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

Patch set 1:Code-Review +2=

Vi= ew Change

1 comment:

  • Patchset:

    • Patch Set #1:

      Indeed, this patch makes sense - if it would b= e NULL, the check is too late, so in this place it does not add anything us= eful.

      After s= taring at the code for quite some time I am reasonably convinced that c2.di= d_open_tun will only be set if `do_open_tun()` was called, which will eithe= r have a previously-set tuntap or will allocate a new one in `do_init_tun()= `.

      `do_close_= tun()` seems to be the only code path that could set `tuntap =3D NULL` (and= it does not clear `did_open_tun`), but it is only called in sequences wher= e it's either reopened right away, or where the instance ends for good.=

To view, visit change 772. To unsubscribe, or for hel= p writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9966636163c7dfa208d26f1cadb= f5b81937f3a34
Gerrit-Change-Number: 772
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Wed, 25 Sep 2024 15:10:41= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--QHVV6n8vlGI=--