Prechádzať zdrojové kódy

qcacld-3.0: Don't notify userspace about link peer

In security association scenario, if userspace gets notified about the
link peer first, it will cancel the connection because it doesn't
contain RSN IEs. Skip notifying userspace about this STA because it is
not needed.

Change-Id: I726583ade6d463bf7eed79d83afc0bcd1ae8192f
CRs-fixed: 3075695
Lincoln Tran 3 rokov pred
rodič
commit
c0290cada6
1 zmenil súbory, kde vykonal 35 pridanie a 16 odobranie
  1. 35 16
      core/hdd/src/wlan_hdd_hostapd.c

+ 35 - 16
core/hdd/src/wlan_hdd_hostapd.c

@@ -1921,6 +1921,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 #ifdef WLAN_FEATURE_11BE_MLO
 	struct wlan_objmgr_peer *peer;
 #endif
+	bool notify_new_sta = true;
+
 	dev = context;
 	if (!dev) {
 		hdd_err("context is null");
@@ -2407,6 +2409,19 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 				hdd_err("Failed to register STA MLD %d "
 					QDF_MAC_ADDR_FMT, qdf_status,
 					QDF_MAC_ADDR_REF(event->sta_mld.bytes));
+
+			peer = wlan_objmgr_get_peer_by_mac(hdd_ctx->psoc,
+							   event->staMac.bytes,
+							   WLAN_OSIF_ID);
+			if (!peer) {
+				hdd_err("Peer object not found");
+				return QDF_STATUS_E_INVAL;
+			}
+
+			if (!wlan_peer_mlme_is_assoc_peer(peer)) {
+				hdd_err("skip userspace notification");
+				notify_new_sta = false;
+			}
 #endif
 		} else {
 			qdf_status = hdd_softap_register_sta(
@@ -2434,21 +2449,23 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 				hdd_err("Failed to register STA MLD %d "
 					QDF_MAC_ADDR_FMT, qdf_status,
 					QDF_MAC_ADDR_REF(event->sta_mld.bytes));
-		peer = wlan_objmgr_get_peer_by_mac(hdd_ctx->psoc,
-						   event->staMac.bytes,
-						   WLAN_OSIF_ID);
-		if (!peer) {
-			hdd_err("Peer object not found");
-			return QDF_STATUS_E_INVAL;
-		}
+			peer = wlan_objmgr_get_peer_by_mac(hdd_ctx->psoc,
+							   event->staMac.bytes,
+							   WLAN_OSIF_ID);
+			if (!peer) {
+				hdd_err("Peer object not found");
+				return QDF_STATUS_E_INVAL;
+			}
 
-		if (!qdf_is_macaddr_zero((struct qdf_mac_addr *)peer->mldaddr)
-		    && !wlan_peer_mlme_is_assoc_peer(peer)) {
-			wlan_objmgr_peer_release_ref(peer, WLAN_OSIF_ID);
-			break;
-		}
+			if (!qdf_is_macaddr_zero((struct qdf_mac_addr *)
+							peer->mldaddr) &&
+			    !wlan_peer_mlme_is_assoc_peer(peer)) {
+				wlan_objmgr_peer_release_ref(peer,
+							     WLAN_OSIF_ID);
+				break;
+			}
 
-		wlan_objmgr_peer_release_ref(peer, WLAN_OSIF_ID);
+			wlan_objmgr_peer_release_ref(peer, WLAN_OSIF_ID);
 #endif
 		}
 
@@ -2507,9 +2524,11 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 			 */
 			sta_info->filled |= STATION_INFO_ASSOC_REQ_IES;
 #endif
-			cfg80211_new_sta(dev,
-				(const u8 *)&event->staMac.bytes[0],
-				sta_info, GFP_KERNEL);
+			if (notify_new_sta)
+				cfg80211_new_sta(dev,
+						 (const u8 *)&event->
+						 staMac.bytes[0],
+						 sta_info, GFP_KERNEL);
 			qdf_mem_free(sta_info);
 		}
 		/* Lets abort scan to ensure smooth authentication for client */