From patchwork Sun Dec 30 18:36:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWljaGFsIFByw612b3puw61r?= X-Patchwork-Id: 1019492 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=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rf9vhYmc"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Sc1M6ZBFz9s2P for ; Mon, 31 Dec 2018 10:22:46 +1100 (AEDT) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=a9EnwMcn/yykXJ+bF8DhA4yl/YyttlXlUbi03+frA3E=; b=rf9vhYmc6aVlUD vW89Sd2sra8LL+2OvEMVkN8YNpE7yqEZNSu7nYfH8ShXMcEXB6ne2Ul9RLIvE9GZBaiNDpdy8ZzXT gUG6F6DIp1vzRVUePf0f/JsC8cKSh488l/aplJnyIf8LaOweYnPekkO9dRJMM2LykEQMrtSI/jYoi Ug0Hrs8TnFQLxQnLSceJwFB0MTrbPZ+xqP7dgycz2onNkixnOajj7YbZmOHkpKQa7Wl2UPIsZQcbV PCP8mKc7p+KtYaAlv0Nbg316oK3ys7gM/O4FxwZHJ4pqJVeb69eNOiqqE2uNR3GQD/z5PKtehjkQS I9pKs0+hyX24pfTLoPqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gdkPe-0006Ks-AE; Sun, 30 Dec 2018 23:22:30 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gdfyH-0004Wr-RD for hostap@lists.infradead.org; Sun, 30 Dec 2018 18:37:59 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9030987623 for ; Sun, 30 Dec 2018 18:37:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 441025C689 for ; Sun, 30 Dec 2018 18:37:32 +0000 (UTC) From: Michal Privoznik To: hostap@lists.infradead.org Subject: [PATCH] wpa_supplicant: Fix build with !CONFIG_AP and CONFIG_CTRL_IFACE_DBUS_NEW Date: Sun, 30 Dec 2018 19:36:22 +0100 Message-Id: <838cee8eac66f8a842b30631625da20a4fa87631.1546194955.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 30 Dec 2018 18:37:45 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181230_103757_946135_DB7DF1D2 X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [209.132.183.28 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Mailman-Approved-At: Sun, 30 Dec 2018 15:22:28 -0800 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: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If the CONFIG_CTRL_IFACE_DBUS_NEW is enabled but CONFIG_AP is disabled the build fails. This is because dbus getters try to access ap_iface member of wpa_supplicant struct which is defined if and only if CONFIG_AP is enabled. Signed-off-by: Michal Privoznik --- Not subscribed to the list, please keep me CC'ed. wpa_supplicant/dbus/dbus_new_handlers.c | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index 2a6ad5818..edb9a65b3 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -3823,7 +3823,9 @@ dbus_bool_t wpas_dbus_getter_stas( DBusMessageIter *iter, DBusError *error, void *user_data) { struct wpa_supplicant *wpa_s = user_data; +#ifdef CONFIG_AP struct hostapd_data *hapd; +#endif /* CONFIG_AP */ struct sta_info *sta = NULL; char **paths = NULL; unsigned int i = 0, num = 0; @@ -3835,11 +3837,13 @@ dbus_bool_t wpas_dbus_getter_stas( return FALSE; } +#ifdef CONFIG_AP if (wpa_s->ap_iface) { hapd = wpa_s->ap_iface->bss[0]; sta = hapd->sta_list; num = hapd->num_sta; } +#endif /* CONFIG_AP */ paths = os_calloc(num, sizeof(char *)); if (!paths) { @@ -3887,6 +3891,7 @@ dbus_bool_t wpas_dbus_getter_sta_address( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; @@ -3897,6 +3902,9 @@ dbus_bool_t wpas_dbus_getter_sta_address( return wpas_dbus_simple_array_property_getter(iter, DBUS_TYPE_BYTE, sta->addr, ETH_ALEN, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -3913,6 +3921,7 @@ dbus_bool_t wpas_dbus_getter_sta_aid( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; @@ -3923,6 +3932,9 @@ dbus_bool_t wpas_dbus_getter_sta_aid( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16, &sta->aid, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -3939,6 +3951,7 @@ dbus_bool_t wpas_dbus_getter_sta_caps( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; @@ -3949,6 +3962,9 @@ dbus_bool_t wpas_dbus_getter_sta_caps( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16, &sta->capability, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -3965,6 +3981,7 @@ dbus_bool_t wpas_dbus_getter_sta_rx_packets( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; struct hostap_sta_driver_data data; @@ -3984,6 +4001,9 @@ dbus_bool_t wpas_dbus_getter_sta_rx_packets( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64, &data.rx_packets, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -4000,6 +4020,7 @@ dbus_bool_t wpas_dbus_getter_sta_tx_packets( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; struct hostap_sta_driver_data data; @@ -4019,6 +4040,9 @@ dbus_bool_t wpas_dbus_getter_sta_tx_packets( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64, &data.tx_packets, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -4035,6 +4059,7 @@ dbus_bool_t wpas_dbus_getter_sta_tx_bytes( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; struct hostap_sta_driver_data data; @@ -4054,6 +4079,9 @@ dbus_bool_t wpas_dbus_getter_sta_tx_bytes( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64, &data.tx_bytes, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ } @@ -4070,6 +4098,7 @@ dbus_bool_t wpas_dbus_getter_sta_rx_bytes( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { +#ifdef CONFIG_AP struct sta_handler_args *args = user_data; struct sta_info *sta; struct hostap_sta_driver_data data; @@ -4089,6 +4118,9 @@ dbus_bool_t wpas_dbus_getter_sta_rx_bytes( return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64, &data.rx_bytes, error); +#else /* CONFIG_AP */ + return FALSE; +#endif /* CONFIG_AP */ }