From 5c5d475747a12fb6fb2784f5f0a50229f8970571 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 8 Sep 2023 11:34:55 +0800 Subject: [PATCH] =?UTF-8?q?:fix(vpn):=E8=BF=9E=E6=8E=A5=E6=97=B6=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=B8=BA=E5=85=B6=E4=BB=96=E8=99=9A=E6=8B=9F=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=B9=9F=E5=8F=AF=E6=89=A7?= =?UTF-8?q?=E8=A1=8C(#190696)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbus-interface/kyvpnconnectoperation.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/backend/dbus-interface/kyvpnconnectoperation.cpp b/src/backend/dbus-interface/kyvpnconnectoperation.cpp index adee3ffb..a2c99f1f 100644 --- a/src/backend/dbus-interface/kyvpnconnectoperation.cpp +++ b/src/backend/dbus-interface/kyvpnconnectoperation.cpp @@ -66,8 +66,14 @@ void KyVpnConnectOperation::getConnectionSetting(QString connectUuid, KyVpnConfi connectSetting.m_ifaceName = connectionSettings->interfaceName(); connectSetting.m_isAutoConnect = connectionSettings->autoconnect(); - if (connectionSettings->connectionType() != NetworkManager::ConnectionSettings::Vpn) { - return ; + if (NetworkManager::ConnectionSettings::ConnectionType::Vpn != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Bond != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Bridge != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Vlan != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Team != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::IpTunnel != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Wired != connectPtr->settings()->connectionType()) { + return; } QDBusPendingReply reply = connectPtr->secrets(KYVPN_VPN_KEY); @@ -1481,7 +1487,13 @@ void KyVpnConnectOperation::activateVpnConnection(const QString connectUuid) return; } - if (NetworkManager::ConnectionSettings::Vpn != connectPtr->settings()->connectionType()) { + if (NetworkManager::ConnectionSettings::ConnectionType::Vpn != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Bond != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Bridge != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Vlan != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Team != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::IpTunnel != connectPtr->settings()->connectionType() + && NetworkManager::ConnectionSettings::ConnectionType::Wired != connectPtr->settings()->connectionType()) { QString errorMessage = tr("the connect type is") + connectPtr->settings()->connectionType() + tr(", but it is not vpn");