wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

f1340704@lhbvm177:~/work4/ti_yocto$ git diff

diff --git /wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

/wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

index b055e684a..31cf7f4f1 100644

--- /wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

+++ /wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

@@ -867,12 +867,28 @@ struct nl80211_bss_info_arg {

const u8 *bssid;

};

+#define WLAN_EID_SSID 0

+static const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)

+{

  • size_t ie_len = res->ie_len;

  • /* Use the Beacon frame IEs if res->ie_len is not available */

  • if (!ie_len)

  • ie_len = res->beacon_ie_len;

  • return get_ie((const u8 *) (res + 1), ie_len, ie);

+}

static int bss_info_handler(struct nl_msg *msg, void *arg)

{

diff --git a/wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

b/wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

index b055e684a..31cf7f4f1 100644

--- a//wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

+++ b/wpa_supplicant-2.11/src/drivers/driver_nl80211_scan.c

@@ -867,12 +867,28 @@ struct nl80211_bss_info_arg {

const u8 *bssid;

};

+#define WLAN_EID_SSID 0

+static const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie)

+{

  • size_t ie_len = res->ie_len;

  • /* Use the Beacon frame IEs if res->ie_len is not available */

  • if (!ie_len)

  • ie_len = res->beacon_ie_len;

  • return get_ie((const u8 *) (res + 1), ie_len, ie);

+}

static int bss_info_handler(struct nl_msg *msg, void *arg)

{

struct nl80211_bss_info_arg *_arg = arg;

struct wpa_scan_results *res = _arg->res;

struct wpa_scan_res **tmp;

struct wpa_scan_res *r;

  • const u8 *ssid;

  • u8 ssid_name[36] = {0};

r = nl80211_parse_bss_info(_arg->drv, msg, _arg->bssid);

if (!r)

@@ -882,6 +898,12 @@ static int bss_info_handler(struct nl_msg *msg, void *arg)

os_free(r);

return NL_SKIP;

}

  • ssid = wpa_scan_get_ie(r, WLAN_EID_SSID);

  • strncpy(ssid_name, ssid + 2, (size_t)ssid[1]);

  • wpa_printf(MSG_DEBUG, "[ssh] ssid_name: %s ", ssid_name);

tmp = os_realloc_array(res->res, res->num + 1,

sizeof(struct wpa_scan_res *));

if (tmp == NULL) {

相关推荐
霖.247 分钟前
K8s实践中的重点知识
linux·云原生·kubernetes
truesnow11 分钟前
速通 awk:一篇文章带你理解 awk 原理,大量实战案例让你马上成为 awk 专家
linux
Lyre丶40 分钟前
Ubuntu 24.04 LTS 安装GAMIT
linux·经验分享·学习·ubuntu·gamit
namekong843 分钟前
ubuntu 通过下面几种方式查看系统 重启时间/开机时间:
linux·运维·ubuntu
qiu_zhongya44 分钟前
iree 用C++来运行Qwen 2.5 0.5b
开发语言·c++·人工智能
汪宁宇44 分钟前
giflib5.2.2 在Qt与VS C++中实现Gif缩放示例
开发语言·c++·qt
啊?啊?1 小时前
C/C++练手小项目之倒计时与下载进度条模拟
c语言·开发语言·c++
爱奥尼欧1 小时前
【Linux】网络部分——网络基础(协议与网络传输)
linux·网络·arm开发
求一个demo1 小时前
Qt5.14.2配置MSVC2017
开发语言·qt
_dindong1 小时前
Linux系统编程:线程概念
linux·运维·笔记·学习