소스 검색

qcacld-3.0: Reject sched scan requests on non-STA ifaces

Scheduled scan (a.k.a Preferred Network Offload, PNO) is intended to be
used only for station interfaces. However, it has been observed that
userspace will send scheduled scan requests for non-station interfaces.
Reject requests to start or stop a scheduled scan on non-station
interfaces.

Change-Id: If5abd242f134518ac4e3d942c1513c66b5c50ff3
CRs-Fixed: 2295101
Dustin Brown 6 년 전
부모
커밋
380cb4592f
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      core/hdd/src/wlan_hdd_scan.c

+ 8 - 3
core/hdd/src/wlan_hdd_scan.c

@@ -1256,7 +1256,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 	struct hdd_context *hdd_ctx;
 	int ret;
 
-	hdd_enter();
+	hdd_enter_dev(dev);
 
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
@@ -1266,8 +1266,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 	if (wlan_hdd_validate_session_id(adapter->session_id))
 		return -EINVAL;
 
-	if (QDF_NDI_MODE == adapter->device_mode) {
-		hdd_err("Command not allowed for NDI interface");
+	if (adapter->device_mode != QDF_STA_MODE) {
+		hdd_info("Sched scans only supported on STA ifaces");
 		return -EINVAL;
 	}
 
@@ -1387,6 +1387,11 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
 	if (errno)
 		return errno;
 
+	if (adapter->device_mode != QDF_STA_MODE) {
+		hdd_info("Sched scans only supported on STA ifaces");
+		return -EINVAL;
+	}
+
 	errno = wlan_hdd_validate_context(WLAN_HDD_GET_CTX(adapter));
 	if (errno)
 		return errno;