From patchwork Wed Apr 20 09:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xinpeng wang X-Patchwork-Id: 1619423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=i0sosx40; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KjwHs26nCz9sG0 for ; Wed, 20 Apr 2022 19:25:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wM8RDk6io9BdyyF/5lnMxHxMpmLdnIWBLP0R7ZV75Qg=; b=i0sosx40OoqNgL 7AVrzOQ6hOpObIwvSrodsACNwBN+cTJpQKsFnXj8//Oppk/EfAmFSD7g6ZbL8kVF9kRtb3O3Zde0j cCVt0i9RqxEU+/qdF8HksSzeAx2vujyBMjXaXgYugEz5eHgQzb0kDmglEZ0sIgOFhVc26th8AGk2k v+sUD4Gj3vPflzYFApyaK5MyXUppkLr62lZ30IMJ2vlqgbW8eWCRljep3EguFyCV+HkubYrk1w3pE DFDOKJekfVnNahE3SnH17PnqxKcy/BHVTEX0xUtsGWUs3WDh7S3yQeqFjzCakevS/R7Z+GN7vjqAN WupT6aanVzBDIKS5xhmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh6ZL-008JMN-P2; Wed, 20 Apr 2022 09:24:15 +0000 Received: from smtpbg704.qq.com ([203.205.195.105] helo=smtpproxy21.qq.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh6ZI-008JIk-8Z for hostap@lists.infradead.org; Wed, 20 Apr 2022 09:24:14 +0000 X-QQ-mid: bizesmtp85t1650446623ti6pwehk Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 20 Apr 2022 17:23:35 +0800 (CST) X-QQ-SSF: 01400000002000D0D000000A0000000 X-QQ-FEAT: k0yT7W7BRd22cIr5RV+CUBpj41TTYczow5JJLRzrWyaMm3nBfTJbySbvXGhrh +Rjh4wbqjdjpv2glpke4T5lsZf5ccQaMppKqqVPxU7hwlgw2PL+KS7z5kprmf6KwZzM3MNN wrjEgPmoXYp9Ib/vBBcJ6B0ntBOJzShXv2e1mZuCh37q+gUEaVncI530YS5ETME+xkgAUhW e9iHvM3c8eAPsU+CMBYbPmIs+VrSUpSESodK7te0amixq3Im/+ympW4Nw1bcguSv40VXTF/ OhzB4rFlNpMXc7Fa8lHag8r2NLPCa32GzgBLH1IDd94jdJom61bJDVdfa3yy7TQ0rtZWNvZ 50Ml8crI/JvbRceIkVgBJUfR1GJow== X-QQ-GoodBg: 2 From: xinpeng wang To: hostap@lists.infradead.org Cc: xinpeng wang Subject: [PATCH] scan: Added printing of ssid in dump scan res Date: Wed, 20 Apr 2022 17:23:32 +0800 Message-Id: <20220420092332.1094-1-wangxinpeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign10 X-QQ-Bgrelay: 1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_022412_379477_12EA06F6 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Added printing of ssid in dump scan res for easy reading and debugging Signed-off-by: xinpeng wang --- wpa_supplicant/scan.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) Content analysis details: (3.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.195.105 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [113.57.152.160 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [203.205.195.105 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Added printing of ssid in dump scan res for easy reading and debugging Signed-off-by: xinpeng wang --- wpa_supplicant/scan.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index b0094ca6c..310d39233 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -2172,6 +2172,8 @@ static void dump_scan_res(struct wpa_scan_results *scan_res) { #ifndef CONFIG_NO_STDOUT_DEBUG size_t i; + const u8 *ssid_ie, *ssid; + size_t ssid_len; if (scan_res->res == NULL || scan_res->num == 0) return; @@ -2181,20 +2183,34 @@ static void dump_scan_res(struct wpa_scan_results *scan_res) for (i = 0; i < scan_res->num; i++) { struct wpa_scan_res *r = scan_res->res[i]; u8 *pos; + ssid_ie = wpa_scan_get_ie(r, WLAN_EID_SSID); + if (ssid_ie != NULL) { + ssid = ssid_ie+2; + ssid_len = ssid_ie[1]; + } else { + ssid = NULL; + ssid_len = 0; + } if (r->flags & WPA_SCAN_LEVEL_DBM) { int noise_valid = !(r->flags & WPA_SCAN_NOISE_INVALID); - wpa_printf(MSG_EXCESSIVE, MACSTR " freq=%d qual=%d " + wpa_printf(MSG_EXCESSIVE, MACSTR + " ssid=%s freq=%d qual=%d " "noise=%d%s level=%d snr=%d%s flags=0x%x age=%u est=%u", - MAC2STR(r->bssid), r->freq, r->qual, + MAC2STR(r->bssid), + wpa_ssid_txt(ssid, ssid_len), + r->freq, r->qual, r->noise, noise_valid ? "" : "~", r->level, r->snr, r->snr >= GREAT_SNR ? "*" : "", r->flags, r->age, r->est_throughput); } else { - wpa_printf(MSG_EXCESSIVE, MACSTR " freq=%d qual=%d " + wpa_printf(MSG_EXCESSIVE, MACSTR + " ssid=%s freq=%d qual=%d " "noise=%d level=%d flags=0x%x age=%u est=%u", - MAC2STR(r->bssid), r->freq, r->qual, + MAC2STR(r->bssid), + wpa_ssid_txt(ssid, ssid_len), + r->freq, r->qual, r->noise, r->level, r->flags, r->age, r->est_throughput); }