[Openvpn-devel,2/5] tun.c: Remove dead code

Message ID 20210321144627.1621-2-simon@rozman.si
State Accepted
Headers show
Series [Openvpn-devel,1/5] MSVC: Disable LZ4 | expand

Commit Message

Kristof Provost via Openvpn-devel March 21, 2021, 3:46 a.m. UTC
Signed-off-by: Simon Rozman <simon@rozman.si>
---
 src/openvpn/tun.c | 34 ----------------------------------
 1 file changed, 34 deletions(-)

Comments

Arne Schwabe March 21, 2021, 5:25 a.m. UTC | #1
Am 21.03.21 um 15:46 schrieb Simon Rozman via Openvpn-devel:
> Signed-off-by: Simon Rozman <simon@rozman.si>
> ---
>  src/openvpn/tun.c | 34 ----------------------------------
>  1 file changed, 34 deletions(-)
> 


Acked-By: Arne Schwabe <arne@rfc2549.org>
Gert Doering March 21, 2021, 5:58 a.m. UTC | #2
Your patch has been applied to the master branch.

"Trivially correct" :-) - but since Windows keeps biting me these
days, test built with Ubuntu/MinGW.  Just to be sure.

commit 26540310efa8c8955f38974969b317460c075dd4
Author: Simon Rozman via Openvpn-devel
Date:   Sun Mar 21 15:46:24 2021 +0100

     tun.c: Remove dead code

     Signed-off-by: Simon Rozman <simon@rozman.si>
     Acked-by: Arne Schwabe <arne@rfc2549.org>
     Message-Id: <20210321144627.1621-2-simon@rozman.si>
     URL: https://www.mail-archive.com/search?l=mid&q=20210321144627.1621-2-simon@rozman.si
     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 6c51a52d..6b7c8ef1 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -85,8 +85,6 @@  static void netsh_command(const struct argv *a, int n, int msglevel);
 
 static const char *netsh_get_id(const char *dev_node, struct gc_arena *gc);
 
-static DWORD get_adapter_index_flexible(const char *name);
-
 static bool
 do_address_service(const bool add, const short family, const struct tuntap *tt)
 {
@@ -4877,38 +4875,6 @@  get_adapter_index(const char *guid)
     return index;
 }
 
-static DWORD
-get_adapter_index_flexible(const char *name)  /* actual name or GUID */
-{
-    struct gc_arena gc = gc_new();
-    DWORD index;
-    index = get_adapter_index_method_1(name);
-    if (index == TUN_ADAPTER_INDEX_INVALID)
-    {
-        index = get_adapter_index_method_2(name);
-    }
-    if (index == TUN_ADAPTER_INDEX_INVALID)
-    {
-        const struct tap_reg *tap_reg = get_tap_reg(&gc);
-        const struct panel_reg *panel_reg = get_panel_reg(&gc);
-        const struct tap_reg *tr = get_adapter_by_name(name, tap_reg, panel_reg);
-        if (tr)
-        {
-            index = get_adapter_index_method_1(tr->guid);
-            if (index == TUN_ADAPTER_INDEX_INVALID)
-            {
-                index = get_adapter_index_method_2(tr->guid);
-            }
-        }
-    }
-    if (index == TUN_ADAPTER_INDEX_INVALID)
-    {
-        msg(M_INFO, "NOTE: could not get adapter index for name/GUID '%s'", name);
-    }
-    gc_free(&gc);
-    return index;
-}
-
 /*
  * Return a string representing a PIP_ADDR_STRING
  */