From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A67C2C433F5 for ; Thu, 17 Mar 2022 12:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234134AbiCQMzc (ORCPT ); Thu, 17 Mar 2022 08:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235142AbiCQMyr (ORCPT ); Thu, 17 Mar 2022 08:54:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7B03B00E; Thu, 17 Mar 2022 05:53:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB68C61240; Thu, 17 Mar 2022 12:53:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2CCCC340E9; Thu, 17 Mar 2022 12:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521610; bh=1n0/fjh8481R1/+vVkCK08P+a7iR+AerTmZh2YvhAQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHI6tfLyxZ2/yge8yuppsTeOLTrfYN0KMZFH7sx13nMDxrXM29e8fzoD0aPbrdjJY 7y/jac5mW7fbQJdKcZ4rFzTVFHheb4HIwuV0GFveQ5ky/I7CiRL6mWMpIoxg3E+Yh7 kOlCrqJqi0sJJ7XBK8PnsZd26frKMDROOo1QzwuE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sreeramya Soratkal , Johannes Berg , Sasha Levin Subject: [PATCH 5.16 23/28] nl80211: Update bss channel on channel switch for P2P_CLIENT Date: Thu, 17 Mar 2022 13:46:14 +0100 Message-Id: <20220317124527.424056121@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124526.768423926@linuxfoundation.org> References: <20220317124526.768423926@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sreeramya Soratkal [ Upstream commit e50b88c4f076242358b66ddb67482b96947438f2 ] The wdev channel information is updated post channel switch only for the station mode and not for the other modes. Due to this, the P2P client still points to the old value though it moved to the new channel when the channel change is induced from the P2P GO. Update the bss channel after CSA channel switch completion for P2P client interface as well. Signed-off-by: Sreeramya Soratkal Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f73251828782..9b4bb1460cef 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17757,7 +17757,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev, wdev->chandef = *chandef; wdev->preset_chandef = *chandef; - if (wdev->iftype == NL80211_IFTYPE_STATION && + if ((wdev->iftype == NL80211_IFTYPE_STATION || + wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && !WARN_ON(!wdev->current_bss)) cfg80211_update_assoc_bss_entry(wdev, chandef->chan); -- 2.34.1