From patchwork Tue Apr 10 16:36:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nirav shah X-Patchwork-Id: 151673 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 80779B705A for ; Wed, 11 Apr 2012 02:37:37 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id CA89E9C14D; Tue, 10 Apr 2012 12:37:33 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id It2oeZpT+O7F; Tue, 10 Apr 2012 12:37:33 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 724F09C1A1; Tue, 10 Apr 2012 12:37:29 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A064D9C1A1 for ; Tue, 10 Apr 2012 12:37:27 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jXbSveYVjBV3 for ; Tue, 10 Apr 2012 12:37:22 -0400 (EDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 78CCB9C14D for ; Tue, 10 Apr 2012 12:37:22 -0400 (EDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Apr 2012 09:37:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="151992319" Received: from nirav-z68a-d3h-b3.hf.intel.com ([10.10.69.83]) by fmsmga002.fm.intel.com with ESMTP; 10 Apr 2012 09:37:21 -0700 From: nirav shah To: hostap@lists.shmoo.com Subject: [PATCH] P2P: Fix Dbus property getters to default to "/" for Group, PeerGO Date: Tue, 10 Apr 2012 09:36:07 -0700 Message-Id: <1334075767-29463-1-git-send-email-nirav.j2.shah@intel.com> X-Mailer: git-send-email 1.7.5.4 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com The Dbus property getters should not return an error when the properties are not valid/relevant. Returning an error breaks the GetAll method in the dbus interface. Changing Group and PeerGO property getters to make GetAll work on P2PDevice. Signed-hostap: Nirav Shah Signed-hostap: Angie Chinchilla intended-for: hostap-1 --- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 62930c7..fb89de9 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -1140,13 +1140,17 @@ dbus_bool_t wpas_dbus_getter_p2p_group(DBusMessageIter *iter, DBusError *error, void *user_data) { struct wpa_supplicant *wpa_s = user_data; + char path_buf[WPAS_DBUS_OBJECT_PATH_MAX]; + char *dbus_groupobj_path = path_buf; if (wpa_s->dbus_groupobj_path == NULL) - return FALSE; + os_snprintf(dbus_groupobj_path, WPAS_DBUS_OBJECT_PATH_MAX, "/"); + else + os_snprintf(dbus_groupobj_path, WPAS_DBUS_OBJECT_PATH_MAX, + "%s", wpa_s->dbus_groupobj_path); return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_OBJECT_PATH, - &wpa_s->dbus_groupobj_path, - error); + &dbus_groupobj_path, error); } @@ -1157,11 +1161,12 @@ dbus_bool_t wpas_dbus_getter_p2p_peergo(DBusMessageIter *iter, char go_peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path; if (wpas_get_p2p_role(wpa_s) != WPAS_P2P_ROLE_CLIENT) - return FALSE; - - os_snprintf(go_peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX, + os_snprintf(go_peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX, "/"); + else + os_snprintf(go_peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX, "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR, wpa_s->dbus_new_path, MAC2STR(wpa_s->go_dev_addr)); + path = go_peer_obj_path; return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_OBJECT_PATH, &path, error);