diff --git a/src/tun/tun.cc b/src/tun/tun.cc index 527c384f..e5f42355 100644 --- a/src/tun/tun.cc +++ b/src/tun/tun.cc @@ -113,13 +113,13 @@ void Tun::handleTunAddr(Msg msg) { return; } - this->tunThread = std::thread([&] { - if (up()) { - spdlog::critical("tun up failed"); - Candy::shutdown(this->client); - return; - } + if (up()) { + spdlog::critical("tun up failed"); + Candy::shutdown(this->client); + return; + } + this->tunThread = std::thread([&] { spdlog::info("start thread: tun"); while (this->client->running) { handleTunDevice();