From patchwork Thu Aug 27 06:15:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jimmy Chen X-Patchwork-Id: 1353507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=mutDQ3SA; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=L/JRUkTb; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 ozlabs.org (Postfix) with ESMTPS id 4BdTzt5NY2z9sTF for ; Sat, 29 Aug 2020 05:24:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:Subject: Message-ID:Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9/5/6dAa+Xx4tkGSNbxg+5+o3wZ0IKoPyigsi1e+w/g=; b=mutDQ3SAYqssESfZei9aZgEDTZ 5hY7fBO3v46qgifJy126lRC8hLVQlBVedeYnXj6C/8RnP4K/S0A7gJRkbounrTeSl01CiRurtbwWV l0dkO9B2rwQW7nISJsXtxdTlv/nFWiqWdlQ+tEYPHbjGBes0hWlZI4qrZIxHXBwmte7yXusV0qvLO Pl6TZ7YYgnJXYRyQqVfL+lnBzvqCKmI6+yh3gwd7sHuNqN/IabXwBvQns2okidpmBWcOVxgJf9qVc 7FqN8YkWHM5fufpbF03SObkizb8APhXHsY7qJiCgY6UEcfdASDnlrVhXCd1+qF3XuWKTAKYfkxVTe CMpQvXDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBjxs-0007th-GU; Fri, 28 Aug 2020 19:23:08 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBBC6-000621-B5 for hostap@lists.infradead.org; Thu, 27 Aug 2020 06:15:31 +0000 Received: by mail-pg1-x533.google.com with SMTP id h12so2594692pgm.7 for ; Wed, 26 Aug 2020 23:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=LEKpdNQMHiah8RwiKK7nEe//lDgn9L76IOP5oRVvFcA=; b=L/JRUkTbT3q8jWSckWrLKUaIw/Uz4OgqsHXRmra77jMe+5+galKZnxq2z46IjXPAf9 Gp2B6FFEVhiZ2CNMFWvPD6/BrUYb9JXZSo6VF0X8eSlnOtN00eCLaCgpC0tTM/UA11bO Is2511smMrnWSXCMj/perlHcuZfpwySdoVwi8eOk0SHOv8h2bPBe2tvdWbQAAkxM4259 7mUZRwr5GFzJSCpPqAIFOOnQstPr9aEjeqQHbEjZKXCObVjfdg30mm+9aDvj4KUUrCD9 VEPu+sOmCL2rD/g5dPGp+RbnU4O3+z+ZgcQ4vTBujdj9Q8q+zh3ydMPSbPgZQ1Vrdn3e DycA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LEKpdNQMHiah8RwiKK7nEe//lDgn9L76IOP5oRVvFcA=; b=g8lvE3Zb4ZEZDiCczQCV7+N1OcW/Bt5Crk3vc2Bt1hZ3xrHAaO38SyTBBVXv/ACBvI xgAK9odhQV6GMLVjUZ6NrVjjqmpPNE9sQspESSEfNkrLd9iSLfi17+zo0bGQE9O+TIHm ARH99XPmtj47bcsL4zLs81s2smUSX5w58qRu55fXCm4CYH9gwK0S7ja5/y7RzctkwL5w t2Rn5hmLYXvQ++0s+Ucpsq1DBTRK+XHh/QjlWiScKUdGdiPsP4Lc0gQhiK8VkLxq5Z51 A5a9a+IYoRJgbsJeKPD/4OnjiEbWFCBwYsf8fIjPFeEybsKr/XzJo41gPhq43o2rsyZq 92zA== X-Gm-Message-State: AOAM533Yc4K2W93yanGQ9UV7Ma/cGRMsASobxcr9zYuiDZ7sELHbCZmE GWaQU5m5p4z1dv49XXU9r3rb4CpFJtpEsccpVPgfMEAztNOKAA== X-Google-Smtp-Source: ABdhPJxPDKd/VlXyYRP0rhH2fWhsi+VC/WoyOHnHzwSIK0noIBlL9x1qn/O1nFt13qabZR4RaFL1yt8CV95tcu3Dpu0= X-Received: by 2002:a62:1bd6:: with SMTP id b205mr3531920pfb.105.1598508927265; Wed, 26 Aug 2020 23:15:27 -0700 (PDT) MIME-Version: 1.0 From: Jimmy Chen Date: Thu, 27 Aug 2020 14:15:16 +0800 Message-ID: Subject: [PATCH] p2p: set ap_configured_cb during p2p group reform process To: hostap@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_021530_457086_7CDD7509 X-CRM114-Status: GOOD ( 14.11 ) X-Spam-Score: -15.7 (---------------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-15.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:533 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.0 SPF_PASS SPF: sender matches SPF record -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF white-list -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.5 ENV_AND_HDR_SPF_MATCH Env and Hdr From used in default SPF WL Match -0.0 DKIMWL_WL_MED DKIMwl.org - Medium sender X-Mailman-Approved-At: Fri, 28 Aug 2020 15:23:06 -0400 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Hi, We found that if REMOVE-AND-REFORM occurs before a group is started, it would not send out GROUP-STARTED-EVENT after AP is enabled. The reason is that ap_configured_cb is cleared in the remove-and-reform process. If a group is not started, p2p_go_configured will not be called after completing AP setup. Best regards, Jimmy From bfdae95156ca2da632e9fec8cdee38244e0ab669 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 26 Aug 2020 18:55:45 +0800 Subject: [PATCH] p2p: set ap_configured_cb during p2p group reform process In the remove-and-reform process, ap_configured_cb is cleared. If a group is not started, p2p_go_configured will not be called after completing AP setup. Signed-off-by: Jimmy Chen --- wpa_supplicant/p2p_supplicant.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index e94bffe52..d7b81ceb0 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -9375,6 +9375,12 @@ static void wpas_p2p_move_go_no_csa(struct wpa_supplicant *wpa_s) /* Stop the AP functionality */ /* TODO: Should do this in a way that does not indicated to possible * P2P Clients in the group that the group is terminated. */ + /* If this action occurs before a group is started, the callback should be + * preserved, or GROUP-STARTED event would loss. If this action occurs after + * a group is started, these poiners are all NULL and harmless. */ + void (*ap_configured_cb)(void *ctx, void *data) = wpa_s->ap_configured_cb; + void *ap_configured_cb_ctx = wpa_s->ap_configured_cb_ctx;; + void *ap_configured_cb_data = wpa_s->ap_configured_cb_data; wpa_supplicant_ap_deinit(wpa_s); /* Reselect the GO frequency */ @@ -9398,6 +9404,9 @@ static void wpas_p2p_move_go_no_csa(struct wpa_supplicant *wpa_s) return; } + wpa_s->ap_configured_cb = ap_configured_cb; + wpa_s->ap_configured_cb_ctx = ap_configured_cb_ctx; + wpa_s->ap_configured_cb_data = ap_configured_cb_data; /* Update the frequency */ current_ssid->frequency = params.freq; wpa_s->connect_without_scan = current_ssid; -- 2.28.0.297.g1956fa8f8d-goog