--- nono/host/hostnet.cpp 2026/04/29 17:05:39 1.1.1.7 +++ nono/host/hostnet.cpp 2026/04/29 17:05:43 1.1.1.8 @@ -239,7 +239,9 @@ HostNetDevice::SelectDriver() bool HostNetDevice::CreateNone() { - driver.reset(new NetDriverNone(this)); + try { + driver.reset(new NetDriverNone(this)); + } catch (...) { } if ((bool)driver) { if (driver->InitDriver()) { // 成功 @@ -256,7 +258,9 @@ bool HostNetDevice::CreateSlirp() { #if defined(HAVE_HOSTNET_SLIRP) - driver.reset(new NetDriverSlirp(this)); + try { + driver.reset(new NetDriverSlirp(this)); + } catch (...) { } if ((bool)driver) { if (driver->InitDriver()) { // 成功 @@ -279,7 +283,9 @@ HostNetDevice::CreateTap() const ConfigItem& item = gConfig->Find(keyname); const std::string& devpath = item.AsString(); - driver.reset(new NetDriverTap(this, devpath)); + try { + driver.reset(new NetDriverTap(this, devpath)); + } catch (...) { } if ((bool)driver) { if (driver->InitDriver()) { // 成功 @@ -302,7 +308,9 @@ HostNetDevice::CreateBPF() const ConfigItem& item = gConfig->Find(keyname); const std::string& ifname = item.AsString(); - driver.reset(new NetDriverBPF(this, ifname)); + try { + driver.reset(new NetDriverBPF(this, ifname)); + } catch (...) { } if ((bool)driver) { if (driver->InitDriver()) { // 成功 @@ -325,7 +333,9 @@ HostNetDevice::CreateAFPacket() const ConfigItem& item = gConfig->Find(keyname); const std::string& ifname = item.AsString(); - driver.reset(new NetDriverAFPacket(this, ifname)); + try { + driver.reset(new NetDriverAFPacket(this, ifname)); + } catch (...) { } if ((bool)driver) { if (driver->InitDriver()) { // 成功