From: Simon Rozman via Openvpn-devel Date: Sun, 21 Mar 2021 14:46:24 +0000 (+0100) Subject: tun.c: Remove dead code X-Git-Tag: v2.6_beta1~602 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26540310efa8c8955f38974969b317460c075dd4;p=thirdparty%2Fopenvpn.git tun.c: Remove dead code Signed-off-by: Simon Rozman Acked-by: Arne Schwabe 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 --- diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 6c51a52db..6b7c8ef14 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 */