mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fix: control resetIpStack when destroy DnsUtilsLinux
This commit is contained in:
@@ -65,7 +65,7 @@ void DnsUtilsLinux::onResolverUnregistered() {
|
|||||||
DnsUtilsLinux::~DnsUtilsLinux() {
|
DnsUtilsLinux::~DnsUtilsLinux() {
|
||||||
MZ_COUNT_DTOR(DnsUtilsLinux);
|
MZ_COUNT_DTOR(DnsUtilsLinux);
|
||||||
|
|
||||||
if (m_resolver) {
|
if (m_revertOnDestroy && m_resolver) {
|
||||||
if (m_gatewayIfindex > 0)
|
if (m_gatewayIfindex > 0)
|
||||||
setLinkDefaultRoute(m_gatewayIfindex, true);
|
setLinkDefaultRoute(m_gatewayIfindex, true);
|
||||||
|
|
||||||
@@ -119,6 +119,7 @@ bool DnsUtilsLinux::updateResolvers(const QString& ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DnsUtilsLinux::restoreResolvers() {
|
bool DnsUtilsLinux::restoreResolvers() {
|
||||||
|
m_revertOnDestroy = true;
|
||||||
m_pendingIfname.clear();
|
m_pendingIfname.clear();
|
||||||
m_pendingResolvers.clear();
|
m_pendingResolvers.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class DnsUtilsLinux final : public DnsUtils {
|
|||||||
int m_ifindex = 0;
|
int m_ifindex = 0;
|
||||||
int m_gatewayIfindex = 0;
|
int m_gatewayIfindex = 0;
|
||||||
int m_domainRetries = 0;
|
int m_domainRetries = 0;
|
||||||
|
bool m_revertOnDestroy = false;
|
||||||
QMap<int, DnsLinkDomainList> m_linkDomains;
|
QMap<int, DnsLinkDomainList> m_linkDomains;
|
||||||
QScopedPointer<QDBusInterface> m_resolver;
|
QScopedPointer<QDBusInterface> m_resolver;
|
||||||
QString m_pendingIfname;
|
QString m_pendingIfname;
|
||||||
|
|||||||
Reference in New Issue
Block a user