From a848ae9c98ffd9927f8f69b97f3aca2d6ce59694 Mon Sep 17 00:00:00 2001 From: runtime Date: Thu, 17 Sep 2026 02:08:01 +0800 Subject: [PATCH] fix: correct p2p filter in isValidLogicalName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: isValidLogicalName() used contains("p2p") to filter P2P wireless interfaces, which incorrectly matched arm64 PCI domain-encoded interface names like enP2p1s0u2 2. Solution: change contains() to startsWith() so only interface names starting with "p2p" (e.g. p2p0, p2p1) are filtered 3. Impact: arm64 USB netcards with PCI domain=2 no longer get falsely filtered out from the network adapter list fix: 修正 isValidLogicalName 中 p2p 过滤逻辑 1. 根因:isValidLogicalName() 使用 contains("p2p") 过滤 P2P 无线接口,导致 arm64 平台 PCI domain 编码的接口名(如 enP2p1s0u2)被误过滤 2. 解决方案:将 contains() 改为 startsWith(),仅过滤以 "p2p" 开头的接口名(如 p2p0、p2p1) 3. 影响:arm64 平台 PCI domain=2 的 USB 网卡不再被误过滤, 可正确显示在网络适配器列表中 PMS: 239527 --- deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp b/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp index 09fa3731..ca3c4343 100644 --- a/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp +++ b/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp @@ -317,7 +317,7 @@ void DeviceGenerator::generatorMonitorDevice() bool isValidLogicalName(const QString& logicalName) { - if (logicalName.contains("p2p", Qt::CaseInsensitive) || logicalName.isEmpty()) + if (logicalName.startsWith("p2p", Qt::CaseInsensitive) || logicalName.isEmpty()) return false; QString addressFilePath = "/sys/class/net/" + logicalName;