From nobody Tue Oct 5 15:35:54 2021 X-Original-To: wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D776812BC1E6 for ; Tue, 5 Oct 2021 15:35:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP1rV5Y1bz3L7b for ; Tue, 5 Oct 2021 15:35:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E5067265 for ; Tue, 5 Oct 2021 15:35:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 195FZs4T054539 for ; Tue, 5 Oct 2021 15:35:54 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 195FZsId054538 for wireless@FreeBSD.org; Tue, 5 Oct 2021 15:35:54 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: wireless@FreeBSD.org Subject: [Bug 258948] [net80211] AP + STA configuration can lead to the AP VAP stopping traffic after STA scan Date: Tue, 05 Oct 2021 15:35:54 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: adrian@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: wireless@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258948 Bug ID: 258948 Summary: [net80211] AP + STA configuration can lead to the AP VAP stopping traffic after STA scan Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: wireless Assignee: wireless@FreeBSD.org Reporter: adrian@freebsd.org Here's a fun very hilarious corner case when you start using STA + AP configurations. My test setup: * An AR9380 radio with a STA VAP (DWDS child / upstream facing) and AP VAP * A second AR9380 radio with AP VAPs with DWDS parent / downstream facing configured * bridging between them all When the STA VAP decides that it needs to scan to find a new AP, sometimes = the AP will stop traffic / 802.1x negotiation, even after the STA VAP finishes scanning and reassociates. After like a year of narrowing things down, I've finally figured out what's going on: * there are STA beacon miss events, which lead net80211/wpa_supplicant to m= ove from RUN to SCAN state * this calls markwaiting(), which will mark all the other VAPs as waiting * this calls vap->iv_newstate(vap, INIT, ...) to set the state to INIT for = each other VAP on the radio * Then some packet is transmitted on the AP VAP via ieee80211_vap_transmit(= ), and since it's not in the RUN state, the OACTIVE flag is set on vap->iv_ifp * .. time passes .. * Finally, the STA VAP transitions through its states to eventually hit RUN * .. which will call wakeupwaiting() * .. which iterates over all the VAPs again and calls vap->iv_newstate(vap, RUN, ...) .. now at this point, the VAP specific mode newstate code and the driver specific newstate code is running, but! Note! These codepaths aren't going = via the ieee80211_new_state() / ieee80211_new_state_locked(), and the only path that clears OACTIVE is in here. * Then eventually a call to ieee80211_new_state*() is done for the AP VAP, setting the state to RUN * However! The deferred taskqueue (ieee80211_new_state_cb()) code sees a st= ate going RUN->RUN, rather than RUN->INIT->RUN, thus it does NOT clear OACTIVE. This is why associations worked fine, but the raw BPF sends did not - ieee80211_output() (used by BPF) checks OACTIVE flag and just drops the packets. The real eventual fix is removing OACTIVE, but this does require a pass thr= ough all the wifi drivers to make sure none of them are using OACTIVE anymore. The temporary fix is just to clear the OACTIVE flag in ieee80211_new_state_= cb() if the state is RUN, even if it's RUN->RUN. --=20 You are receiving this mail because: You are the assignee for the bug.=