fix: keep DNS and routing during seamless Xray switch on macOS

This commit is contained in:
cd-amn
2026-06-16 20:18:24 +04:00
parent eda9ed8016
commit e9cd043b10
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -361,6 +361,9 @@ bool IpcServer::restoreResolvers()
qDebug() << "IpcServer::restoreResolvers";
#endif
if (m_xrayWorkers.size() > 1) {
return true;
}
return Router::restoreResolvers();
}
@@ -640,6 +643,9 @@ bool IpcServer::xrayRemoveUplinkRoutes(const QString& uplinkIface, const QString
if (uplinkIface.isEmpty()) {
return false;
}
if (m_xrayWorkers.size() > 1) {
return true;
}
return RouterMac::Instance().routeDeleteXray(uplinkIface, uplinkGateway);
#else
Q_UNUSED(uplinkIface)
+2
View File
@@ -26,6 +26,8 @@ bool RouterMac::routeAdd(const QString &ipWithSubnet, const QString &gw)
return false;
}
routeDelete(ipWithSubnet, gw);
QString cmd;
if (mask == "255.255.255.255") {
cmd = QString("route add -host %1 %2").arg(ip).arg(gw);