[Openvpn-devel] tun.c: remove unused gc_arena from init_tun()

Message ID 20220809072220.255-1-lstipakov@gmail.com
State Accepted
Headers show
Series [Openvpn-devel] tun.c: remove unused gc_arena from init_tun() | expand

Commit Message

Lev Stipakov Aug. 8, 2022, 9:22 p.m. UTC
From: Lev Stipakov <lev@openvpn.net>

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 src/openvpn/tun.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Antonio Quartulli Aug. 8, 2022, 9:37 p.m. UTC | #1
Hi,

On 09/08/2022 09:22, Lev Stipakov wrote:
> From: Lev Stipakov <lev@openvpn.net>
> 
> Signed-off-by: Lev Stipakov <lev@openvpn.net>

This gc thing is indeed unused and can go.

Acked-by: Antonio Quartulli <a@unstable.cc>

> ---
>   src/openvpn/tun.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
> index 54f7d72c..f3152a52 100644
> --- a/src/openvpn/tun.c
> +++ b/src/openvpn/tun.c
> @@ -745,7 +745,6 @@ init_tun(const char *dev,        /* --dev option */
>            struct env_set *es,
>            openvpn_net_ctx_t *ctx)
>   {
> -    struct gc_arena gc = gc_new();
>       struct tuntap *tt;
>   
>       ALLOC_OBJ(tt, struct tuntap);
> @@ -878,7 +877,6 @@ init_tun(const char *dev,        /* --dev option */
>           do_ifconfig_setenv(tt, es);
>       }
>   
> -    gc_free(&gc);
>       return tt;
>   }
>
Gert Doering Aug. 8, 2022, 11:22 p.m. UTC | #2
Your patch has been applied to the master branch.

Good catch.  No idea when and why we lost the users of this...

commit 0585a4bf1a5ba9cf2051a7d65ac0628bf7164299
Author: Lev Stipakov
Date:   Tue Aug 9 10:22:20 2022 +0300

     tun.c: remove unused gc_arena from init_tun()

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Antonio Quartulli <a@unstable.cc>
     Message-Id: <20220809072220.255-1-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24851.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 54f7d72c..f3152a52 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -745,7 +745,6 @@  init_tun(const char *dev,        /* --dev option */
          struct env_set *es,
          openvpn_net_ctx_t *ctx)
 {
-    struct gc_arena gc = gc_new();
     struct tuntap *tt;
 
     ALLOC_OBJ(tt, struct tuntap);
@@ -878,7 +877,6 @@  init_tun(const char *dev,        /* --dev option */
         do_ifconfig_setenv(tt, es);
     }
 
-    gc_free(&gc);
     return tt;
 }