From 30854deba6c2f8d848e142513f345f582580ebd5 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Mon, 19 Oct 2020 17:41:01 +0800 Subject: [PATCH] fix: TAP Mode first time searching adapter --- Netch/Controllers/TUNTAPController.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Netch/Controllers/TUNTAPController.cs b/Netch/Controllers/TUNTAPController.cs index c1567d641a..c035d8bc76 100644 --- a/Netch/Controllers/TUNTAPController.cs +++ b/Netch/Controllers/TUNTAPController.cs @@ -54,12 +54,18 @@ public bool Start(in Mode mode) } // 查找并安装 TAP 适配器 - if (!SearchTapAdapter() && !AddTap()) + if (!SearchTapAdapter()) { - Logging.Error("Tap 适配器安装失败"); - return false; + if (!AddTap()) + { + Logging.Error("Tap 适配器安装失败"); + return false; + } + + SearchTapAdapter(); } + SetupRouteTable(); string dns;