From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4BD4471264 for ; Tue, 21 Jul 2026 18:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657525; cv=none; b=RDK3vru3iJTGqiPA/e2njIL9B44mvQnOaUTbc3LAcZm9BA+eh3hTh2Qt/kJBsXSdKCH9ldOxPdV8BAPAGK+kSJ4sVPD8zl+R8nrFRWCnTuS3QRD+NwuFhML8ArO1sIkaA9Peqs8AuIPLzeHSb0E0cyHO02gdZmV6FkPn0bGS5Ks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657525; c=relaxed/simple; bh=CDa6T/n2NUwOYTPApJaM+nQTzvN39brHZzjYqCSnEIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D/HRtc8y0wYMwh2nb88TaCoV3omjdFRO+karbJTHOhydF3d75aZhcyTkEiz4KODpkvLYRWd28KxXWv3HAPQ3Lj/V98yKoNFiW2dJWtBf4U52OttgUh2+V++Sxz4/6Zc04bDUwvvDA/7wZQ8bCy9EXj7Pgl7wnYsHheN2MhHQBpw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z3BFb0Qa; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z3BFb0Qa" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-47f785467faso1701842f8f.2 for ; Tue, 21 Jul 2026 11:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784657522; x=1785262322; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=atzuAW8BUPg7t2P/PauMDGaY2DZmWpTjfQUjtUYsIO4=; b=Z3BFb0Qax+NipooLZVE3xknRqul1xsGFAlB5EQnbq5HG6LcoVI6xHXzb625kz2mQE6 adoHuUkN75vsE05FqQwz1UGTuSzc4BjxbDhc+Y4DhPLzj6ml2LIbDWGmStJUiRnOmgsk lkBsO5CcFvnrn0sbOI/eeLq+DDJEWVc/FSB6VyLaldI0qo5FyzZ5k9WrAjSNDqURbhMl zpKvRzBKX0k8BzBqRXgqxjVPUhmAcENfguaTVrrK97l/x+Frf/FxbQD/vubszO4AjQ9Q RrtpbTBs/ZoE/n52IN6xSwRiBQlX1noBrJn1YJNrjVxdubzxf1RNelrFN9wbyrdi/sPK UHMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784657522; x=1785262322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=atzuAW8BUPg7t2P/PauMDGaY2DZmWpTjfQUjtUYsIO4=; b=QzkbHPT7SHdtpByOZPXkasxk5K2wVHJ1JOrBFF3hKPimGpxb32QipeqG/zpov18ZV3 ygMrFBMDUCU1OzFFDwAnWhUJKZWQlQc47ttxhMzE5pg7FojFQgfsrMUJ+IMRzEupLing cLJO8I4kG9vKAN55Nf/BJ6MD3OP4Sh6IM5lg7zeQP+f+Ey5JuCBOgcOHOH7I1jWaChoX Jd6MRHrbAIiCDcc0WnCBTqRD8L52pI9nPpJqdXYnNC7f/S+G7R9qeCERSgSVH1gHfpXN T5yg4ozQIYrvhWCB0X1K0rT8wIu8XunFlT3XvDLeBvWH+Px9GyFbPxlMQmdyf8OBe4fR Dwdw== X-Forwarded-Encrypted: i=1; AHgh+RoXBmFiRU/WIKpx46QkjVpoOwYm6W5eG0VtAYKCMVFaxVnIsrPgOVEl00M/5kyrSQ4AnOZv80hAAVQMvBc=@vger.kernel.org X-Gm-Message-State: AOJu0YwRptFsHGS7fF03FRroGpxzh33VISLf5yyMf1dpDTB+/S33LWKZ HarMA5YQ0iPvrfFCbGrSU08N82ecVW3MMsJKzVVo3J3jllcO34NzYocy X-Gm-Gg: AR+sD12bL7TqeGkpZvQsv1YJ9KW01333i2YpifKAXPcGi7WoIjemcVk8kwEs/Go9MNJ NYoDPZIwKvoTzJ/izCpcHjR/MBwqobn2ouxmMkL47xd+/96sFYWMRF6DojaIyEwyN3tuCYk2acz 2wwkRhEeYVoOlU6vmCtARtrpyPXd1A1tuiX0dZRfdzjO3Fs2hv8ZAB7/JAwWMTUVUf4c0HbDE3g pOf9z5WlXhfsiZTl3Qd4jg0hHH9shBPXBHiFgE7Dts98Gup8it02QYtpIOFqnucHgZiIuDnouu2 SkUcxi8tdYYlGTHtXyF1fgxVjD/XpercOpEp50EFmMndnry6sikfc9sVsRgt+dYLdHs1wKeFayY 48PFQi0EWUcQID9Sa96OBfKWbOM0iZ3oWKlC0nQ9aK6GH+O8vBqRm/k0d45oOVbXT555RocuB/S h/QQ3A/UkogdHl/m7RGChWUr5x1tATAy3G6Bma X-Received: by 2002:a5d:5e8d:0:b0:47d:fc33:e6bc with SMTP id ffacd0b85a97d-47f623310ffmr23845481f8f.47.1784657521636; Tue, 21 Jul 2026 11:12:01 -0700 (PDT) Received: from localhost ([102.128.173.0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f67466e09sm44781875f8f.21.2026.07.21.11.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 11:12:01 -0700 (PDT) From: Louis Kotze To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, loukot@gmail.com Subject: [PATCH v2 0/2] wifi: cfg80211: say why the auth/assoc BSS lookup failed Date: Tue, 21 Jul 2026 20:11:56 +0200 Message-ID: <20260721181158.3004022-1-loukot@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <2629d83dd460f3d9a60566f3fad975db13b045c3.camel@sipsolutions.net> References: <2629d83dd460f3d9a60566f3fad975db13b045c3.camel@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The BSS lookup for an authentication or association request can fail because no scan entry exists, because the entry is expired, or because the entry's use_for flags forbid the requested use. All three currently produce the same generic (or no) diagnostic, which wpa_supplicant relays verbatim as the only hint a user gets when e.g. an MLO association degrades to fewer links. Patch 1 makes __cfg80211_get_bss() record the reason via an optional extack while it walks the BSS table, and wires the auth and assoc paths up to it. Patch 2 adds a KUnit test for the reported reasons. v2: per Johannes' feedback on v1, drop the separate failure-path classification helper (which re-walked the table and could race against it changing); the reason is now captured in __cfg80211_get_bss() itself, during the same bss_lock walk that fails the lookup, and the public cfg80211_get_bss() wrapper just passes NULL. Since the reporting now lives in the lookup, the previously silent authentication path gets the same messages for free, and a KUnit test (new in v2) can cover all the reasons deterministically. Demonstrated end-to-end in a mac80211_hwsim VM: with an unpatched wpa_supplicant failing an MLD reassociation on a stale per-link BSS, the supplicant log now shows nl80211: kernel reports: BSS not found in scan results nl80211: kernel reports error for link: 1 instead of the undiscriminating "Error fetching BSS for link". Louis Kotze (2): wifi: cfg80211: say why the auth/assoc BSS lookup failed wifi: cfg80211: tests: check BSS lookup failure reasons include/net/cfg80211.h | 7 ++- net/wireless/nl80211.c | 28 +++++---- net/wireless/scan.c | 35 ++++++++--- net/wireless/tests/scan.c | 122 +++++++++++++++++++++++++++++++++++++- 4 files changed, 170 insertions(+), 22 deletions(-) base-commit: ac798f757d6475dc6fee2ec899980d6740714596 -- 2.55.0