fix(wireless): drop default MAC binding on connect - #608
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: caixr23 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves automatic persistence of a wireless device’s permanent MAC address during connection creation and activation, preventing interference with randomized-MAC auto-reconnect while leaving explicit user-selected bindings under WirelessSection control. Sequence diagram for wireless connection without default MAC bindingsequenceDiagram
participant User
participant WirelessDeviceManagerRealize
participant NetWirelessConnect
participant WirelessSection
participant ConnectionProfile
User->>WirelessDeviceManagerRealize: connectNetwork(accessPoint)
WirelessDeviceManagerRealize->>ConnectionProfile: setSsid(ssid)
WirelessDeviceManagerRealize->>ConnectionProfile: setInitialized(true)
User->>NetWirelessConnect: activateConnection()
NetWirelessConnect->>ConnectionProfile: setAutoconnect(false)
User->>WirelessSection: Select NIC binding or Not Bind
WirelessSection->>ConnectionProfile: setMacAddress(selectedMacOrEmpty)
ConnectionProfile-->>User: Profile keeps explicit binding or cleared MAC
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c42df76 to
618eb33
Compare
1. Remove code that wrote the device permanent/real hardware address into the Wireless setting when creating or activating a connection (WirelessDeviceManagerRealize::connectNetwork, NetWirelessConnect::activateConnection) 2. Keep user-selected device binding in WirelessSection 3. A pinned MAC defeats random-MAC mode and blocks auto-connect after reboot, leaving wifi disconnected Log: Wireless auto-reconnects after reboot with random MAC enabled Influence: 1. Connect to WiFi, reboot, verify it reconnects automatically 2. Bind a wireless connection to a specific NIC in control center, verify profile keeps that mac-address 3. Choose "Not Bind", verify mac-address cleared from profile fix(wireless): 默认不再将连接绑定到网卡MAC地址 1. 移除创建/激活连接时将设备永久/真实硬件地址写入无线配置的代码 (WirelessDeviceManagerRealize::connectNetwork、 NetWirelessConnect::activateConnection) 2. 保留控制中心 WirelessSection 中用户手动选择的网卡绑定 3. 固定 MAC 会破坏随机 MAC 功能,且导致重启后无线无法自动回连 Log: 开启随机 MAC 后,重启系统可自动重连无线网络 Influence: 1. 连接 WiFi 后重启系统,验证能自动重连 2. 控制中心绑定指定网卡后,验证配置保留该 mac-address 3. 选择"不绑定",验证配置中 mac-address 已清空 PMS: BUG-374945
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 无需修改,代码变更逻辑清晰,移除操作完整且不影响后续代码流程。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 代码变更干净利落,注释和版权信息同步更新,无需额外修改。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 移除不必要的 MAC 地址字符串处理操作,轻微提升性能,无需优化。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 移除 MAC 地址绑定反而有助于提升隐私保护(允许 MAC 随机化),无需安全加固。 💡 改进建议代码示例// 本次变更为移除代码,无需修复示例
// 移除的代码块(netwirelessconnect.cpp, activateConnection 方法):
// // 默认设置Mac地址
// NetworkManager::WirelessSetting::Ptr wirelessSetting =
// m_connectionSettings->setting(NetworkManager::Setting::Wireless)
// .dynamicCast<NetworkManager::WirelessSetting>();
// if (wirelessSetting) {
// QString macAddress = m_device->realHwAdr();
// macAddress.remove(":");
// wirelessSetting->setMacAddress(QByteArray::fromHex(macAddress.toUtf8()));
// wirelessSetting->setInitialized(true);
// }
//
// 移除的代码块(devicemanagerrealize.cpp, connectNetwork 方法):
// QString macAddress = m_device->permanentHardwareAddress();
// macAddress.remove(":");
// wirelessSetting->setMacAddress(QByteArray::fromHex(macAddress.toUtf8()));本报告由 AI 代码审查工具自动生成 |
Log: Wireless auto-reconnects after reboot with random MAC enabled
Influence:
fix(wireless): 默认不再将连接绑定到网卡MAC地址
Log: 开启随机 MAC 后,重启系统可自动重连无线网络
Influence:
PMS: BUG-374945
Summary by Sourcery
Remove default wireless MAC binding so randomized-MAC connections can reconnect automatically while retaining user-selected device bindings.
Bug Fixes:
Enhancements: