From patchwork Mon Feb 12 19:27:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasyl Vavrychuk X-Patchwork-Id: 872353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="CMH/8spJ"; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YsiPPS+5"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MhqbMsaW"; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgG8z5N63z9s7f for ; Tue, 13 Feb 2018 06:35:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=LoM6vIMSTj7Ppxn3rFc0bg8FAqag6gFmIZbwqY4DIsQ=; b=CMH/8spJAilRpMbLjRf0en3B9m 9u2wCJA6dUP+aLb6hfB0X/5AsZF8R8H3Ma5sg1jncvzKmS080Cd8+hkIH694rk2yV6n35G0hZFAG3 gAFF2+T7FYi1tl4HQ4G/HlsrohtmTwmw5lBPv8GZgdO+agL3rw1ft40Sug69KmazE83mVFzAMYngJ 5Z3FehfbNlxwLCQhrfUCySnIIozkF9FZ46JKTqVJtbGsblFieNfzVQ2Gy4x4ynljxBqm1LMsri31v lxmFGqTpKh9ekE7AZdyn2QFAjDLYVkM7+RigBYHCP2LO8JrSL3NVfiNW4suGSKb6dztsrOEeGg7ux WscHC07Q==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elJsX-0002Gw-HC for incoming@patchwork.ozlabs.org; Mon, 12 Feb 2018 19:35:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=LoM6vIMSTj7Ppxn3rFc0bg8FAqag6gFmIZbwqY4DIsQ=; b=Ysi PPS+5QuEzc6dav58AArWj6e02awbHBIjWdEJPXiuB0i2nGtK8o4PBTPQ1jiz/fnoY0sKEBU/9/N67 Q8QEqX3P7YirD6unyKQJwKs+LFtK3bArVp3cVib7fJlRYlXXEouPqQ8WhrT78N8BSj2B7mCdeWsDc tpegB2QVVkq5WRAzwmUgqgjrd+5LDMclpYJiuTUCo/2W+rA6wG4ZRdtElvytS6kuGweyqJhws12x5 c5rGNOyKexBc6F/r+7NE3BUjkfbn8x7M/z/KaOzg/d14CkJ/KHqdlzuIThPavH/caNzEc0oh00Ngs OMEbPzljhEQW+hrMfwl3w+adfr2Ln3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1elJlQ-0004m1-1k; Mon, 12 Feb 2018 19:27:44 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elJlN-0004Eo-Ej for hostap@lists.infradead.org; Mon, 12 Feb 2018 19:27:42 +0000 Received: by mail-lf0-x244.google.com with SMTP id j193so5957865lfe.0 for ; Mon, 12 Feb 2018 11:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Zpq2I17cAYCRnH0/IDSNCCJQQnmLA6uLWXHUb8TFr5c=; b=MhqbMsaWh2UScmZcdy5MLzAm5wf5wlYqvtY7GbIsHa39vyp3ycIzSv9ji3G7SxJOdT +RdljDt5KMDHrj0Culu06LFQIqvFC4CJstcWPW4LrwLwA6/AEdROl7GU0KEdApTMGAiQ HBZdkrNQHhkddqq0lujocchyUoO1Sc4RJVotpXiGa/Q20+3GkxT3wwyZPe6OJFwMZlDA 2bUP0kz/O+Sw+lt0e+vUn5ekxeC7Ijo2CAisN3DAB13SL0H5Cj2ejzKuchecJk+BbQVd 3L/6Cpx1DO3g6jRh7ZV+sk3Izh5Jf33tKUAXWc5pRssweQQ7tJ54K50v8C3HpWnRDU/r bPhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Zpq2I17cAYCRnH0/IDSNCCJQQnmLA6uLWXHUb8TFr5c=; b=UyhKOOhTPZB2mFhZoqs7KktAyOnfgnKScOQbJvc5Cv9+hsS0uJf5f6D5vgM9nCPYnl c4K0CEh4pDs45d4Qe8WsNoyhox7SThWko8b3Gzonav618xYXTxjasBbx/fz0fad9c5Ka zBzeseyDpe5dpdRUg6+RiUsEqG60htUEK1yhNwcu/7KaTyW7YSc0j/F3FZKcdEyYMimP jsdJg+dh8//6yGWBgKGDSgwFFjO2o/b8ySzbwylhlgvLv4wlBQEHC8XVN1/ll2ahhngZ sm1xcHDUK6Bxe5cTQMZq9fs220RRVfDSJlTYbSdve+Cha7qwNsGUEoZQa7nDQV2eT3lw iEMg== X-Gm-Message-State: APf1xPD3tyhyV+2o6bcT9aX7M9sug09nYKQxTmHg0LXt0biGzYKr0H1P 69YzEtUC3homuFEtgLYda4w9ZQ== X-Google-Smtp-Source: AH8x226xqZebieDdU+Ai1Z+BNRdb2nzKgDWrEdV0fzPG9M7dADzsAoZRLKQstJrSrzDWHNHDzIj/WA== X-Received: by 10.46.18.84 with SMTP id t81mr8056656lje.76.1518463648762; Mon, 12 Feb 2018 11:27:28 -0800 (PST) Received: from zbook.synapse.com ([185.145.181.165]) by smtp.gmail.com with ESMTPSA id s1sm539429ljd.13.2018.02.12.11.27.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 11:27:28 -0800 (PST) From: Vasyl Vavrychuk To: hostap@lists.infradead.org Subject: [PATCH] fixed missing FindStopped in the case of separate P2P-Device interface Date: Mon, 12 Feb 2018 21:27:20 +0200 Message-Id: <20180212192720.14325-1-vvavrychuk@gmail.com> X-Mailer: git-send-email 2.11.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:244 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (vvavrychuk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasyl Vavrychuk MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Propagate similiar change to p2p_group_formation_failure and p2p_invitation_received. Some wireless controllers might have separate P2P-Device interface, see as example result of 'iw dev': phy#0 Unnamed/non-netdev interface ... type P2P-device ... Interface wlp2s0 type managed ... In this case there is separate 'struct wpa_supplicant' created for this p2p-dev-* device as result of 'wpa_supplicant_add_iface > wpas_p2p_add_p2pdev_interface > wpa_supplicant_add_iface'. This instance of wpa_supplicant is not registered in D-Bus (wpas_dbus_register_*) since for corresponding P2P device interface flag 'struct wpa_interface > p2p_mgmt' is set. But this instance is saved in p2p_init_wpa_s and is used for handling P2P related D-Bus commands. Therefore we should look for D-Bus path in the parent of p2p_init_wpa_s instance. Without this change test dbus_p2p_discovery starts failing if we set support_p2p_device in vm-run.sh. Signed-off-by: Vasyl Vavrychuk --- wpa_supplicant/dbus/dbus_new.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 8115f7721..e0f16bbda 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -2027,6 +2027,9 @@ void wpas_dbus_signal_p2p_group_formation_failure(struct wpa_supplicant *wpa_s, if (iface == NULL) return; + if (wpa_s->p2p_mgmt) + wpa_s = wpa_s->parent; + msg = dbus_message_new_signal(wpa_s->dbus_new_path, WPAS_DBUS_NEW_IFACE_P2PDEVICE, "GroupFormationFailure"); @@ -2068,6 +2071,9 @@ void wpas_dbus_signal_p2p_invitation_received(struct wpa_supplicant *wpa_s, if (iface == NULL) return; + if (wpa_s->p2p_mgmt) + wpa_s = wpa_s->parent; + msg = dbus_message_new_signal(wpa_s->dbus_new_path, WPAS_DBUS_NEW_IFACE_P2PDEVICE, "InvitationReceived"); @@ -4266,7 +4272,13 @@ void wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s) iface = wpa_s->global->dbus; /* Do nothing if the control interface is not turned on */ - if (iface == NULL || !wpa_s->dbus_new_path) + if (iface == NULL) + return; + + if (wpa_s->p2p_mgmt) + wpa_s = wpa_s->parent; + + if (!wpa_s->dbus_new_path) return; msg = dbus_message_new_signal(wpa_s->dbus_new_path,