瀏覽代碼

qcacld-3.0: control mac spoofing scan by INI

The function wlan_hdd_cfg80211_scan_randomization_init
will set mac spoofing scan feature ignore the ini
configuration on gEnableMacAddrSpoof.

CRs-fixed: 2108137
Change-Id: I8164aa15e83c6fbe1a4249efeca4c7f6474604f8
Paul Zhang 7 年之前
父節點
當前提交
382248f646
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      core/hdd/src/wlan_hdd_cfg80211.c

+ 9 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -12950,8 +12950,15 @@ int wlan_hdd_cfg80211_update_band(struct hdd_context *hdd_ctx, struct wiphy *wip
 	(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
 static void wlan_hdd_cfg80211_scan_randomization_init(struct wiphy *wiphy)
 {
-	wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
-	wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR;
+	struct hdd_context *hdd_ctx;
+	hdd_ctx = wiphy_priv(wiphy);
+
+	if (false == hdd_ctx->config->enable_mac_spoofing) {
+		hdd_warn("MAC address spoofing is not enabled");
+	} else {
+		wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
+		wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR;
+	}
 }
 #else
 static void wlan_hdd_cfg80211_scan_randomization_init(struct wiphy *wiphy)