mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-19 02:00:45 +07:00
fix: keep DNS and routing during seamless Xray switch on macOS
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user