a.brooks2 | 21 Dec 08:22 2014

dbus signallPoll() timeouts

Hi,

I'm having an issue with the signalPoll() dbus method.
If I leave a computer running for a day or three, calling signalPoll() 
at ~1Hz, eventually it gets stuck in a state where my client process 
sits at 100% CPU, occasionally returning the following error message:

"Did not receive a reply. Possible causes include: the remote 
application did not send a reply, the message bus security policy 
blocked the reply, the reply timeout expired, or the network connection 
was broken."

Restarting my client process resets everything (without restarting 
wpa_supplicant).

I attached gdb to my process, here's where it's sitting:

#7  0xb4463a0f in dbus_pending_call_block () from 
/lib/i386-linux-gnu/libdbus-1.so.3
#8  0xb4452b95 in dbus_connection_send_with_reply_and_block () from 
/lib/i386-linux-gnu/libdbus-1.so.3
#9  0xb5e57dd9 in ?? () from /usr/lib/i386-linux-gnu/libQt5DBus.so.5
#10 0xb5e44290 in QDBusConnection::call(QDBusMessage const&, 
QDBus::CallMode, int) const () from 
/usr/lib/i386-linux-gnu/libQt5DBus.so.5
#11 0xb5e636be in 
QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode, QString 
const&, QList<QVariant> const&) () from 
/usr/lib/i386-linux-gnu/libQt5DBus.so.5
#12 0xb5e64968 in QDBusAbstractInterface::call(QDBus::CallMode, QString 
(Continue reading)

Trivelly, Jean | 19 Dec 12:03 2014
Picon

P2P Clear p2p_scan_running on P2P_STOP_FIND call

Hi Jouni,

 

Could you please review this patch ?

If it is OK for you, could you please merge it ?

 

Thanks a lot,

Jean

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Masashi Honma | 19 Dec 06:59 2014
Picon

[PATCH 1/3] mesh: Make max peer links configurable

Max peer links is max number of connecting mesh peers at the same time.
Max peer links is greater than 0 and smaller than 255.
Because dot11MeshNumberOfPeerings is in the range.

Signed-off-by: Masashi Honma <masashi.honma <at> gmail.com>
---
 src/drivers/driver.h         | 1 +
 src/drivers/driver_nl80211.c | 4 ++++
 wpa_supplicant/config.c      | 2 ++
 wpa_supplicant/config.h      | 8 ++++++++
 wpa_supplicant/mesh.c        | 3 ++-
 5 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 4fcc648..b8ee825 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
 <at>  <at>  -953,6 +953,7  <at>  <at>  struct wpa_driver_mesh_join_params {
 	int ie_len;
 	int freq;
 	int beacon_int;
+	int max_peer_links;
 	enum ht_mode ht_mode;
 	struct wpa_driver_mesh_bss_params conf;
 #define WPA_DRIVER_MESH_FLAG_USER_MPM	0x00000001
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index f6d5507..cfd3b70 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
 <at>  <at>  -7809,6 +7809,10  <at>  <at>  wpa_driver_nl80211_join_mesh(void *priv,
 	if (!(params->conf.flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
 	    nla_put_u32(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, 0))
 		goto fail;
+	if ((params->conf.flags & WPA_DRIVER_MESH_FLAG_DRIVER_MPM) &&
+	    nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
+			params->max_peer_links))
+		goto fail;
 	nla_nest_end(msg, container);

 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index bd80b29..d3a8c86 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
 <at>  <at>  -3450,6 +3450,7  <at>  <at>  struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
 	config->eapol_version = DEFAULT_EAPOL_VERSION;
 	config->ap_scan = DEFAULT_AP_SCAN;
 	config->user_mpm = DEFAULT_USER_MPM;
+	config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
 	config->fast_reauth = DEFAULT_FAST_REAUTH;
 	config->p2p_go_intent = DEFAULT_P2P_GO_INTENT;
 	config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS;
 <at>  <at>  -3998,6 +3999,7  <at>  <at>  static const struct global_parse_data global_fields[] = {
 	{ FUNC(bgscan), 0 },
 #ifdef CONFIG_MESH
 	{ INT(user_mpm), 0 },
+	{ INT_RANGE(max_peer_links, 0, 255), 0 },
 #endif /* CONFIG_MESH */
 	{ INT(disable_scan_offload), 0 },
 	{ INT(fast_reauth), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 2c3d6f5..c8cdca2 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
 <at>  <at>  -16,6 +16,7  <at>  <at> 
 #define DEFAULT_AP_SCAN 1
 #endif /* CONFIG_NO_SCAN_PROCESSING */
 #define DEFAULT_USER_MPM 1
+#define DEFAULT_MAX_PEER_LINKS 99
 #define DEFAULT_FAST_REAUTH 1
 #define DEFAULT_P2P_GO_INTENT 7
 #define DEFAULT_P2P_INTRA_BSS 1
 <at>  <at>  -1111,6 +1112,13  <at>  <at>  struct wpa_config {
 	 * If AMPE or SAE is enabled, the MPM is always in userspace.
 	 */
 	int user_mpm;
+
+	/**
+	 * max_peer_links - Max peer links
+	 *
+	 * Max number of mesh peering currently maintained by the STA.
+	 */
+	int max_peer_links;
 };

 
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 7adfa63..7a4f3de 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
 <at>  <at>  -169,7 +169,7  <at>  <at>  static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 	bss->iconf = conf;
 	ifmsh->conf = conf;

-	ifmsh->bss[0]->max_plinks = 99;
+	ifmsh->bss[0]->max_plinks = wpa_s->conf->max_peer_links;
 	os_strlcpy(bss->conf->iface, wpa_s->ifname, sizeof(bss->conf->iface));

 	mconf = mesh_config_create(ssid);
 <at>  <at>  -323,6 +323,7  <at>  <at>  int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
 		params.beacon_int = ssid->beacon_int;
 	else if (wpa_s->conf->beacon_int > 0)
 		params.beacon_int = wpa_s->conf->beacon_int;
+	params.max_peer_links = wpa_s->conf->max_peer_links;
 #ifdef CONFIG_IEEE80211N
 	params.ht_mode = ssid->mesh_ht_mode;
 #endif /* CONFIG_IEEE80211N */
--

-- 
1.9.1
David Woodhouse | 18 Dec 16:07 2014

[PATCH 0/6] OpenSSL PKCS#11 improvements

If we build with GnuTLS, PKCS#11 use is simple. You just put a standard
PKCS#11 URI¹ into the client_cert or private_key fields, and it Just
Works™. It'll search the PKCS#11 tokens which are enabled in the
system's p11-kit configuration, and find the object you require.
(It's not quite perfect though — it doesn't support using PKCS#11 for
ca_cert, and it doesn't support tokens that require a PIN. I may look at
those later.)

This set of patches fixes the OpenSSL side to behave similarly, so the
configuration is be the same regardless of which crypto library you
build against.

Now, all I need to do is provide something like the following in my
network config:

 client_cert="pkcs11:manufacturer=piv_II;id=%01"
 private_key="pkcs11:manufacturer=piv_II;id=%01"
 pin="123456"

These patches depend on some fixes to engine_pkcs11² in order to work,
but will fail gracefully if the old engine (or no engine) is found. The
old baroque OpenSSL-specific method of explicit configuration will also
continue to work, with both old and new engines.

--

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse <at> intel.com                              Intel Corporation

¹ https://tools.ietf.org/html/draft-pechanec-pkcs11uri-16
² https://github.com/OpenSC/engine_pkcs11/pull/9
Attachment (smime.p7s): application/x-pkcs7-signature, 7762 bytes
_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
David Woodhouse | 18 Dec 14:11 2014

[PATCH] Support private_key_passwd for GnuTLS (3.1.11+)

It's possible to jump through hoops to support it in older versions too,
but that seems a little unnecessary at this point.

Signed-off-by: David Woodhouse <David.Woodhouse <at> intel.com>
---
 src/crypto/tls_gnutls.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/crypto/tls_gnutls.c b/src/crypto/tls_gnutls.c
index cb23eb9..6001f2c 100644
--- a/src/crypto/tls_gnutls.c
+++ b/src/crypto/tls_gnutls.c
 <at>  <at>  -563,16 +563,29  <at>  <at>  int tls_connection_set_params(void *tls_ctx, struct tls_connection *conn,
 	}

 	if (params->client_cert && params->private_key) {
-		/* TODO: private_key_passwd? */
+#if GNUTLS_VERSION_NUMBER >= 0x03010b
+		ret = gnutls_certificate_set_x509_key_file2(
+			conn->xcred, params->client_cert, params->private_key,
+			GNUTLS_X509_FMT_PEM, params->private_key_passwd, 0);
+#else
+		/* private_key_passwd not (easily) supported here */
 		ret = gnutls_certificate_set_x509_key_file(
 			conn->xcred, params->client_cert, params->private_key,
 			GNUTLS_X509_FMT_PEM);
+#endif
 		if (ret < 0) {
 			wpa_printf(MSG_DEBUG, "Failed to read client cert/key "
 				   "in PEM format: %s", gnutls_strerror(ret));
+#if GNUTLS_VERSION_NUMBER >= 0x03010b
+			ret = gnutls_certificate_set_x509_key_file2(
+				conn->xcred, params->client_cert,
+				params->private_key, GNUTLS_X509_FMT_DER,
+				params->private_key_passwd, 0);
+#else
 			ret = gnutls_certificate_set_x509_key_file(
 				conn->xcred, params->client_cert,
 				params->private_key, GNUTLS_X509_FMT_DER);
+#endif
 			if (ret < 0) {
 				wpa_printf(MSG_DEBUG, "Failed to read client "
 					   "cert/key in DER format: %s",
-- 
2.1.0

--

-- 
dwmw2
Attachment (smime.p7s): application/x-pkcs7-signature, 7762 bytes
_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Mathieu Trudel-Lapierre | 18 Dec 02:58 2014
Picon

[PATCH] Expose connected stations on DBus.

Make it possible to list connected stations in AP mode over DBus, along
with some of their properties.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre <at> canonical.com>

---
 wpa_supplicant/dbus/dbus_new.c          |  247 ++++++++++++++++++++++++--
 wpa_supplicant/dbus/dbus_new.h          |   25 ++
 wpa_supplicant/dbus/dbus_new_handlers.c |  297 ++++++++++++++++++++++++++++++++
 wpa_supplicant/dbus/dbus_new_handlers.h |   32 +++
 wpa_supplicant/notify.c                 |    6 
 5 files changed, 592 insertions(+), 15 deletions(-)

Index: b/wpa_supplicant/dbus/dbus_new.c
===================================================================
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
 <at>  <at>  -24,6 +24,7  <at>  <at> 
 #include "dbus_common_i.h"
 #include "dbus_new_handlers_p2p.h"
 #include "p2p/p2p.h"
+#include "ap/sta_info.h"

 #ifdef CONFIG_AP /* until needed by something else */

 <at>  <at>  -878,15 +879,19  <at>  <at>  nomem:
  * Notify listeners about event related with station
  */
 static void wpas_dbus_signal_sta(struct wpa_supplicant *wpa_s,
-				 const u8 *sta, const char *sig_name)
+				 const u8 *sta, const char *sig_name,
+                                 int properties)
 {
 	struct wpas_dbus_priv *iface;
 	DBusMessage *msg;
-	char sta_mac[WPAS_DBUS_OBJECT_PATH_MAX];
-	char *dev_mac;
+	DBusMessageIter iter;
+	char sta_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+	char *path;

-	os_snprintf(sta_mac, WPAS_DBUS_OBJECT_PATH_MAX, MACSTR, MAC2STR(sta));
-	dev_mac = sta_mac;
+	os_snprintf(sta_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+		    "%s/" WPAS_DBUS_NEW_STAS_PART "/" COMPACT_MACSTR,
+		    wpa_s->dbus_new_path, MAC2STR(sta));
+	path = sta_obj_path;

 	iface = wpa_s->global->dbus;

 <at>  <at>  -895,19 +900,33  <at>  <at>  static void wpas_dbus_signal_sta(struct
 		return;

 	msg = dbus_message_new_signal(wpa_s->dbus_new_path,
-				      WPAS_DBUS_NEW_IFACE_INTERFACE, sig_name);
+				      WPAS_DBUS_NEW_IFACE_INTERFACE,
+				      sig_name);
 	if (msg == NULL)
 		return;

-	if (dbus_message_append_args(msg, DBUS_TYPE_STRING, &dev_mac,
-				     DBUS_TYPE_INVALID))
-		dbus_connection_send(iface->con, msg, NULL);
-	else
-		wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+	dbus_message_iter_init_append(msg, &iter);
+	if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
+					    &path))
+		goto err;
+
+	if (properties) {
+		if (!wpa_dbus_get_object_properties(iface, path,
+						    WPAS_DBUS_NEW_IFACE_STA,
+						    &iter))
+			goto err;
+	}
+
+	wpa_printf(MSG_DEBUG, "dbus: Station MAC address '" MACSTR "' '%s'",
+		   MAC2STR(sta), sig_name);
+
+	dbus_connection_send(iface->con, msg, NULL);
 	dbus_message_unref(msg);
+	return;

-	wpa_printf(MSG_DEBUG, "dbus: Station MAC address '%s' '%s'",
-		   sta_mac, sig_name);
+err:
+	wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+	dbus_message_unref(msg);
 }

 
 <at>  <at>  -921,7 +940,7  <at>  <at>  static void wpas_dbus_signal_sta(struct
 void wpas_dbus_signal_sta_authorized(struct wpa_supplicant *wpa_s,
 				     const u8 *sta)
 {
-	wpas_dbus_signal_sta(wpa_s, sta, "StaAuthorized");
+	wpas_dbus_signal_sta(wpa_s, sta, "StaAuthorized", TRUE);
 }

 
 <at>  <at>  -935,7 +954,7  <at>  <at>  void wpas_dbus_signal_sta_authorized(str
 void wpas_dbus_signal_sta_deauthorized(struct wpa_supplicant *wpa_s,
 				       const u8 *sta)
 {
-	wpas_dbus_signal_sta(wpa_s, sta, "StaDeauthorized");
+	wpas_dbus_signal_sta(wpa_s, sta, "StaDeauthorized", FALSE);
 }

 
 <at>  <at>  -1817,6 +1836,9  <at>  <at>  void wpas_dbus_signal_prop_changed(struc
 	case WPAS_DBUS_PROP_BSSS:
 		prop = "BSSs";
 		break;
+	case WPAS_DBUS_PROP_STAS:
+		prop = "Stations";
+		break;
 	case WPAS_DBUS_PROP_CURRENT_AUTH_MODE:
 		prop = "CurrentAuthMode";
 		break;
 <at>  <at>  -1900,6 +1922,39  <at>  <at>  void wpas_dbus_bss_signal_prop_changed(s

 
 /**
+ * wpas_dbus_sta_signal_prop_changed - Signals change of STA property
+ *  <at> wpa_s: %wpa_supplicant network interface data
+ *  <at> property: indicates which property has changed
+ *  <at> address: unique BSS identifier
+ *
+ * Sends PropertyChanged signals with path, interface, and arguments depending
+ * on which property has changed.
+ */
+void wpas_dbus_sta_signal_prop_changed(struct wpa_supplicant *wpa_s,
+				       enum wpas_dbus_bss_prop property,
+				       u8 address[ETH_ALEN])
+{
+	char path[WPAS_DBUS_OBJECT_PATH_MAX];
+	char *prop;
+
+	switch (property) {
+	case WPAS_DBUS_STA_PROP_ADDRESS:
+		prop = "Address";
+		break;
+	default:
+		wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
+			   __func__, property);
+		return;
+	}
+
+	os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
+		    "%s/" WPAS_DBUS_NEW_STAS_PART "/" COMPACT_MACSTR,
+		    wpa_s->dbus_new_path, MAC2STR(address));
+
+	wpa_dbus_mark_property_changed(wpa_s->global->dbus, path,
+				       WPAS_DBUS_NEW_IFACE_STA, prop);
+}
+/**
  * wpas_dbus_signal_debug_level_changed - Signals change of debug param
  *  <at> global: wpa_global structure
  *
 <at>  <at>  -2434,6 +2489,164  <at>  <at>  err:
 }

 
+static const struct wpa_dbus_property_desc wpas_dbus_sta_properties[] = {
+	{ "Address", WPAS_DBUS_NEW_IFACE_STA, "ay",
+	  wpas_dbus_getter_sta_address,
+	  NULL
+	},
+	{ "AID", WPAS_DBUS_NEW_IFACE_STA, "q",
+	  wpas_dbus_getter_sta_aid,
+	  NULL
+	},
+	{ "Flags", WPAS_DBUS_NEW_IFACE_STA, "u",
+	  wpas_dbus_getter_sta_flags,
+	  NULL
+	},
+	{ "Capabilities", WPAS_DBUS_NEW_IFACE_STA, "q",
+	  wpas_dbus_getter_sta_caps,
+	  NULL
+	},
+	{ "RxPackets", WPAS_DBUS_NEW_IFACE_STA, "t",
+	  wpas_dbus_getter_sta_rx_packets,
+	  NULL
+	},
+	{ "TxPackets", WPAS_DBUS_NEW_IFACE_STA, "t",
+	  wpas_dbus_getter_sta_tx_packets,
+	  NULL
+	},
+	{ "RxBytes", WPAS_DBUS_NEW_IFACE_STA, "t",
+	  wpas_dbus_getter_sta_rx_bytes,
+	  NULL
+	},
+	{ "TxBytes", WPAS_DBUS_NEW_IFACE_STA, "t",
+	  wpas_dbus_getter_sta_tx_bytes,
+	  NULL
+	},
+	{ NULL, NULL, NULL, NULL, NULL }
+};
+
+
+static const struct wpa_dbus_signal_desc wpas_dbus_sta_signals[] = {
+	/* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
+	{ "PropertiesChanged", WPAS_DBUS_NEW_IFACE_STA,
+	  {
+		  { "properties", "a{sv}", ARG_OUT },
+		  END_ARGS
+	  }
+	},
+	{ NULL, NULL, { END_ARGS } }
+};
+
+
+/**
+ * wpas_dbus_unregister_sta - Unregister a connected station from dbus
+ *  <at> wpa_s: wpa_supplicant interface structure
+ *  <at> bssid: connected station bssid
+ *  <at> id: unique station identifier
+ * Returns: 0 on success, -1 on failure
+ *
+ * Unregisters STA representing object from dbus
+ */
+int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s,
+			     const u8 *sta)
+{
+	struct wpas_dbus_priv *ctrl_iface;
+	char sta_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+
+	/* Do nothing if the control interface is not turned on */
+	if (wpa_s == NULL || wpa_s->global == NULL)
+		return 0;
+	ctrl_iface = wpa_s->global->dbus;
+	if (ctrl_iface == NULL)
+		return 0;
+
+	os_snprintf(sta_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+		    "%s/" WPAS_DBUS_NEW_STAS_PART "/" COMPACT_MACSTR,
+		    wpa_s->dbus_new_path, MAC2STR(sta));
+
+	wpa_printf(MSG_DEBUG, "dbus: Unregister STA object '%s'",
+		   sta_obj_path);
+	if (wpa_dbus_unregister_object_per_iface(ctrl_iface, sta_obj_path)) {
+		wpa_printf(MSG_ERROR, "dbus: Cannot unregister STA object %s",
+			   sta_obj_path);
+		return -1;
+	}
+
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STAS);
+
+	return 0;
+}
+
+
+/**
+ * wpas_dbus_register_sta - Register a scanned station with dbus
+ *  <at> wpa_s: wpa_supplicant interface structure
+ *  <at> bssid: connection network station
+ *  <at> id: unique STA identifier
+ * Returns: 0 on success, -1 on failure
+ *
+ * Registers STA representing object with dbus
+ */
+int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s,
+			   const u8 *sta)
+{
+	struct wpas_dbus_priv *ctrl_iface;
+	struct wpa_dbus_object_desc *obj_desc;
+	char sta_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+	struct sta_handler_args *arg;
+
+	/* Do nothing if the control interface is not turned on */
+	if (wpa_s == NULL || wpa_s->global == NULL)
+		return 0;
+	ctrl_iface = wpa_s->global->dbus;
+	if (ctrl_iface == NULL)
+		return 0;
+
+	os_snprintf(sta_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+		    "%s/" WPAS_DBUS_NEW_STAS_PART "/" COMPACT_MACSTR,
+		    wpa_s->dbus_new_path, MAC2STR(sta));
+
+	obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
+	if (!obj_desc) {
+		wpa_printf(MSG_ERROR, "Not enough memory "
+			   "to create object description");
+		goto err;
+	}
+
+	arg = os_zalloc(sizeof(struct sta_handler_args));
+	if (!arg) {
+		wpa_printf(MSG_ERROR, "Not enough memory "
+			   "to create arguments for handler");
+		goto err;
+	}
+	arg->wpa_s = wpa_s;
+	arg->sta = sta;
+
+	wpas_dbus_register(obj_desc, arg, wpa_dbus_free,
+			   NULL,
+			   wpas_dbus_sta_properties,
+			   wpas_dbus_sta_signals);
+
+	wpa_printf(MSG_DEBUG, "dbus: Register STA object '%s'",
+		   sta_obj_path);
+	if (wpa_dbus_register_object_per_iface(ctrl_iface, sta_obj_path,
+					       wpa_s->ifname, obj_desc)) {
+		wpa_printf(MSG_ERROR,
+			   "Cannot register STA dbus object %s.",
+			   sta_obj_path);
+		goto err;
+	}
+
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STAS);
+
+	return 0;
+
+err:
+	free_dbus_object_desc(obj_desc);
+	return -1;
+}
+
+
 static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
 	{ "Scan", WPAS_DBUS_NEW_IFACE_INTERFACE,
 	  (WPADBusMethodHandler) &wpas_dbus_handler_scan,
 <at>  <at>  -2896,6 +3109,10  <at>  <at>  static const struct wpa_dbus_property_de
 	  wpas_dbus_getter_disconnect_reason,
 	  NULL
 	},
+	{ "Stations", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
+	  wpas_dbus_getter_stas,
+	  NULL
+	},
 	{ NULL, NULL, NULL, NULL, NULL }
 };

Index: b/wpa_supplicant/dbus/dbus_new_handlers.c
===================================================================
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
 <at>  <at>  -22,6 +22,10  <at>  <at> 
 #include "../bss.h"
 #include "../scan.h"
 #include "../autoscan.h"
+#include "../ap.h"
+#include "ap/hostapd.h"
+#include "ap/sta_info.h"
+#include "ap/ap_drv_ops.h"
 #include "dbus_new_helpers.h"
 #include "dbus_new.h"
 #include "dbus_new_handlers.h"
 <at>  <at>  -3385,6 +3389,299  <at>  <at>  dbus_bool_t wpas_dbus_getter_blobs(DBusM
 }

 
+/**
+ * wpas_dbus_getter_stas - Get connected stations for an interface
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: a list of stations
+ *
+ * Getter for "Stations" property.
+ */
+dbus_bool_t wpas_dbus_getter_stas(DBusMessageIter *iter, DBusError *error,
+				  void *user_data)
+{
+	struct wpa_supplicant *wpa_s = user_data;
+	struct hostapd_data *hapd;
+	struct sta_info *sta;
+	char **paths = NULL;
+	unsigned int i = 0;
+	dbus_bool_t success = FALSE;
+
+	if (wpa_s->ap_iface == NULL)
+		goto out;
+
+	hapd = wpa_s->ap_iface->bss[0];
+
+	paths = os_calloc(hapd->num_sta, sizeof(char *));
+	if (!paths) {
+		dbus_set_error_const(error, DBUS_ERROR_NO_MEMORY, "no memory");
+		return FALSE;
+	}
+
+	/* Loop through scan results and append each result's object path */
+	for (sta = hapd->sta_list; sta; sta = sta->next) {
+		paths[i] = os_zalloc(WPAS_DBUS_OBJECT_PATH_MAX);
+		if (paths[i] == NULL) {
+			dbus_set_error_const(error, DBUS_ERROR_NO_MEMORY,
+					     "no memory");
+			goto out;
+		}
+		/* Construct the object path for this BSS. */
+		os_snprintf(paths[i++], WPAS_DBUS_OBJECT_PATH_MAX,
+			    "%s/" WPAS_DBUS_NEW_STAS_PART "/" COMPACT_MACSTR,
+			    wpa_s->dbus_new_path, MAC2STR(sta->addr));
+	}
+
+	success = wpas_dbus_simple_array_property_getter(iter,
+							 DBUS_TYPE_OBJECT_PATH,
+							 paths, hapd->num_sta,
+							 error);
+
+out:
+	while (i)
+		os_free(paths[--i]);
+	os_free(paths);
+	return success;
+}
+
+
+/**
+ * wpas_dbus_getter_sta_address - Return the BSSID of a connected station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "Address" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_address(DBusMessageIter *iter, DBusError *error,
+				         void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+
+	sta = ap_get_sta(args->wpa_s->ap_iface->bss[0], args->sta);
+	if (!sta)
+		return FALSE;
+
+	return wpas_dbus_simple_array_property_getter(iter, DBUS_TYPE_BYTE,
+						      sta->addr, ETH_ALEN,
+						      error);
+}
+
+
+/**
+ * wpas_dbus_getter_sta_aid - Return the AID of a connected station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "AID" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_aid(DBusMessageIter *iter, DBusError *error,
+				     void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+
+	sta = ap_get_sta(args->wpa_s->ap_iface->bss[0], args->sta);
+	if (!sta)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
+						&sta->aid,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_sta_flags - Return the flags of a connected station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "Flags" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_flags(DBusMessageIter *iter, DBusError *error,
+				       void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+
+	sta = ap_get_sta(args->wpa_s->ap_iface->bss[0], args->sta);
+	if (!sta)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT32,
+						&sta->flags,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_sta_caps - Return the capabilities of a station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "Capabilities" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_caps(DBusMessageIter *iter, DBusError *error,
+				      void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+
+	sta = ap_get_sta(args->wpa_s->ap_iface->bss[0], args->sta);
+	if (!sta)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT16,
+						&sta->capability,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_rx_packets - Return the received packets for a station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "RxPackets" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_rx_packets(DBusMessageIter *iter, DBusError *error,
+				            void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+	struct hostap_sta_driver_data data;
+	struct hostapd_data *hapd;
+
+	if (!args->wpa_s->ap_iface)
+		return FALSE;
+
+	hapd = args->wpa_s->ap_iface->bss[0];
+	sta = ap_get_sta(hapd, args->sta);
+	if (!sta)
+		return FALSE;
+
+        if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) < 0)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64,
+						&data.rx_packets,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_tx_packets - Return the transmitted packets for a station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "TxPackets" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_tx_packets(DBusMessageIter *iter, DBusError *error,
+				            void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+	struct hostap_sta_driver_data data;
+	struct hostapd_data *hapd;
+
+	if (!args->wpa_s->ap_iface)
+		return FALSE;
+
+	hapd = args->wpa_s->ap_iface->bss[0];
+	sta = ap_get_sta(hapd, args->sta);
+	if (!sta)
+		return FALSE;
+
+        if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) < 0)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64,
+						&data.tx_packets,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_tx_bytes - Return the transmitted bytes for a station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "TxBytes" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_tx_bytes(DBusMessageIter *iter, DBusError *error,
+				          void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+	struct hostap_sta_driver_data data;
+	struct hostapd_data *hapd;
+
+	if (!args->wpa_s->ap_iface)
+		return FALSE;
+
+	hapd = args->wpa_s->ap_iface->bss[0];
+	sta = ap_get_sta(hapd, args->sta);
+	if (!sta)
+		return FALSE;
+
+        if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) < 0)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64,
+						&data.tx_bytes,
+						error);
+}
+
+
+/**
+ * wpas_dbus_getter_rx_bytes - Return the received bytes for a station
+ *  <at> iter: Pointer to incoming dbus message iter
+ *  <at> error: Location to store error on failure
+ *  <at> user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "RxBytes" property.
+ */
+dbus_bool_t wpas_dbus_getter_sta_rx_bytes(DBusMessageIter *iter, DBusError *error,
+				          void *user_data)
+{
+	struct sta_handler_args *args = user_data;
+	struct sta_info *sta;
+	struct hostap_sta_driver_data data;
+	struct hostapd_data *hapd;
+
+	if (!args->wpa_s->ap_iface)
+		return FALSE;
+
+	hapd = args->wpa_s->ap_iface->bss[0];
+	sta = ap_get_sta(hapd, args->sta);
+	if (!sta)
+		return FALSE;
+
+        if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) < 0)
+		return FALSE;
+
+	return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT64,
+						&data.rx_bytes,
+						error);
+}
+
+
 static struct wpa_bss * get_bss_helper(struct bss_handler_args *args,
 				       DBusError *error, const char *func_name)
 {
Index: b/wpa_supplicant/dbus/dbus_new_handlers.h
===================================================================
--- a/wpa_supplicant/dbus/dbus_new_handlers.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers.h
 <at>  <at>  -20,6 +20,11  <at>  <at>  struct bss_handler_args {
 	unsigned int id;
 };

+struct sta_handler_args {
+	struct wpa_supplicant *wpa_s;
+	const u8 *sta;
+};
+
 dbus_bool_t wpas_dbus_simple_property_getter(DBusMessageIter *iter,
 					     const int type,
 					     const void *val,
 <at>  <at>  -232,6 +237,33  <at>  <at>  dbus_bool_t wpas_dbus_getter_pkcs11_modu
 dbus_bool_t wpas_dbus_getter_blobs(DBusMessageIter *iter, DBusError *error,
 				   void *user_data);

+dbus_bool_t wpas_dbus_getter_stas(DBusMessageIter *iter, DBusError *error,
+				  void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_address(DBusMessageIter *iter, DBusError *error,
+					 void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_aid(DBusMessageIter *iter, DBusError *error,
+				     void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_flags(DBusMessageIter *iter, DBusError *error,
+				       void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_caps(DBusMessageIter *iter, DBusError *error,
+				      void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_rx_packets(DBusMessageIter *iter, DBusError *error,
+				            void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_tx_packets(DBusMessageIter *iter, DBusError *error,
+				            void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_tx_bytes(DBusMessageIter *iter, DBusError *error,
+				          void *user_data);
+
+dbus_bool_t wpas_dbus_getter_sta_rx_bytes(DBusMessageIter *iter, DBusError *error,
+				          void *user_data);
+
 dbus_bool_t wpas_dbus_getter_bss_bssid(DBusMessageIter *iter, DBusError *error,
 				       void *user_data);

Index: b/wpa_supplicant/dbus/dbus_new.h
===================================================================
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
 <at>  <at>  -12,6 +12,7  <at>  <at> 

 #include "common/defs.h"
 #include "p2p/p2p.h"
+#include "ap/sta_info.h"

 struct wpa_global;
 struct wpa_supplicant;
 <at>  <at>  -28,6 +29,7  <at>  <at>  enum wpas_dbus_prop {
 	WPAS_DBUS_PROP_CURRENT_NETWORK,
 	WPAS_DBUS_PROP_CURRENT_AUTH_MODE,
 	WPAS_DBUS_PROP_BSSS,
+	WPAS_DBUS_PROP_STAS,
 	WPAS_DBUS_PROP_DISCONNECT_REASON,
 };

 <at>  <at>  -43,6 +45,10  <at>  <at>  enum wpas_dbus_bss_prop {
 	WPAS_DBUS_BSS_PROP_IES,
 };

+enum wpas_dbus_sta_prop {
+	WPAS_DBUS_STA_PROP_ADDRESS,
+};
+
 #define WPAS_DBUS_OBJECT_PATH_MAX 150

 #define WPAS_DBUS_NEW_SERVICE		"fi.w1.wpa_supplicant1"
 <at>  <at>  -59,6 +65,9  <at>  <at>  enum wpas_dbus_bss_prop {
 #define WPAS_DBUS_NEW_BSSIDS_PART "BSSs"
 #define WPAS_DBUS_NEW_IFACE_BSS	WPAS_DBUS_NEW_INTERFACE ".BSS"

+#define WPAS_DBUS_NEW_STAS_PART "Stations"
+#define WPAS_DBUS_NEW_IFACE_STA	WPAS_DBUS_NEW_INTERFACE ".Station"
+
 #define WPAS_DBUS_NEW_IFACE_P2PDEVICE	\
 		WPAS_DBUS_NEW_IFACE_INTERFACE ".P2PDevice"

 <at>  <at>  -157,6 +166,10  <at>  <at>  int wpas_dbus_unregister_bss(struct wpa_
 			     u8 bssid[ETH_ALEN], unsigned int id);
 int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
 			   u8 bssid[ETH_ALEN], unsigned int id);
+int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s,
+			     const u8 *sta);
+int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s,
+			   const u8 *sta);
 void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
 				 const char *name);
 void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
 <at>  <at>  -316,6 +329,18  <at>  <at>  static inline int wpas_dbus_register_bss
 {
 	return 0;
 }
+
+static inline int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s,
+					   const u8 *sta)
+{
+	return 0;
+}
+
+static inline int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s,
+					 const u8 *sta)
+{
+	return 0;
+}

 static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
 					       const char *name)
Index: b/wpa_supplicant/notify.c
===================================================================
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
 <at>  <at>  -552,6 +552,9  <at>  <at>  static void wpas_notify_ap_sta_authorize
 	wpas_dbus_signal_p2p_peer_joined(wpa_s, sta);
 #endif /* CONFIG_P2P */

+	/* Unregister the station */
+	wpas_dbus_register_sta(wpa_s, sta);
+
 	/* Notify listeners a new station has been authorized */
 	wpas_dbus_signal_sta_authorized(wpa_s, sta);
 }
 <at>  <at>  -576,6 +579,9  <at>  <at>  static void wpas_notify_ap_sta_deauthori

 	/* Notify listeners a station has been deauthorized */
 	wpas_dbus_signal_sta_deauthorized(wpa_s, sta);
+
+	/* Unregister the station */
+	wpas_dbus_unregister_sta(wpa_s, sta);
 }
Stefano Cappa | 17 Dec 17:27 2014
Picon

wpa_cli: connect 3 device in a p2p group with WiFi Direct

Hi,

i can connect two p2p Android devices with this commands:

device1) p2p_connect "address_2" pbc persistent

device2) p2p_connect "address_1" pbc persistent


With this two commands, on device 1 (Group Owner) i get this message:

AP-STA-CONNECTED "address_2" p2p_dev_addr="address_2"

Perfect!


But now i have another Android device, called for example "device3".


Which is the correct commands on device 1, 2 and 3 to create a group of three devices where device 1 is the GO?


device1) ????

device2) probably nothing, because is only a client ;)

device3????


Thank you very much,

please help me, i'm trying for three days without success.

Stefano Cappa




_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Krishna Chaitanya | 17 Dec 16:35 2014
Picon

P2P Channel list: Applying regulatory rules

Hi,

P2P spec 1.5 tells that:

> The Channel List attribute shall indicate the channels that the P2P Device can support as Operating
Channel of the P2P Group if it becomes P2P Group Owner.

So in p2p_buf_add_channel_list We should take in to account the
reg_class flags and accordingly should avoid NO_IR/RADAR/PASSIVE-SCAN
channels from the channel list? because we cannot start AP operation
in those channels.

How do we handle Auto-GO/non-Auto-GO, for regulatory rules. Spec is
not clear about this.

I am preparing a patch to remove those channels for now, later we can
extend to check for DFS availability also.

But want to confirm before spending too much time.

--

-- 
Thanks,
Regards,
Chaitanya T K.
Javier Barroso | 16 Dec 21:22 2014
Picon

How to umount a wpa_supplicant _netdev device at shutdown with systemd ?

Hello,

I'm having a problem with a curlftpfs mount at fstab.

I reported a bug to Debian and a bug to Systemd:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769186
https://bugs.freedesktop.org/show_bug.cgi?id=86707

At Systemd Bugtracker they tell me about wpa_supplicant.service should
have a Before dependency on network.target

That solution did not work to me

Somebody have a wpa_supplicant _netdev device on /etc/fstab and
running systemd the system won't hang on shutdown ?

My problem is that wpa_supplicant deauthenticate to my AP before
curlftpfs can umount the device.

Can you help me ?

Thank you
Aaron Small | 16 Dec 18:24 2014
Picon

wpa_supplicant stops working after pm-suspend

Hello,

I use wpa_supplicant with NetworkManager on linux to connect to wifi. A few months ago after a platform update (I'm not sure exactly what was updated, whether it included wpa_supplicant and/or other things), wifi stopped working after pm-suspend/resume.

I found a workaround is to kill and restart wpa_supplicant after resume, so I left it with that workaround until now, but am now trying to find what actually broke.

So I am wondering: should wpa_supplicant work after pm-suspend/resume, or is it normal that it needs to be restarted? Because I was using it with NetworkManager, I don't know, maybe NetworkManager was restarting it before, and isn't now and that's what broke.

I can reproduce the issue without NetworkManager, with wpa_cli (though I don't know for sure that this would have worked in the past), and from the logs I capture there, it seems like it's at least trying to work, but maybe the kernel isn't letting it - I see this in syslog on resume:

Dec 16 11:40:21 beta kernel: [19624.201689] wlan0: authenticate with 00:24:01:6f:15:3f
Dec 16 11:40:21 beta kernel: [19624.217532] wlan0: send auth to 00:24:01:6f:15:3f (try 1/3)
Dec 16 11:40:21 beta kernel: [19624.219438] wlan0: authenticated
Dec 16 11:40:26 beta kernel: [19629.223804] wlan0: deauthenticating from 00:24:01:6f:15:3f by local choice (reason=3)

and this in wpa_supplicant's log on resume:
wlan0: SME: Trying to authenticate with 00:24:01:6f:15:3f (SSID='oakmore' freq=2437 MHz)
CTRL_IFACE monitor sent successfully to /tmp/wpa_ctrl_9783-21\x00
wlan0: State: SCANNING -> AUTHENTICATING
EAPOL: External notification - EAP success=0
EAPOL: External notification - EAP fail=0
EAPOL: External notification - portControl=Auto
wlan0: Determining shared radio frequencies (max len 1)
wlan0: Shared frequencies (len=0): completed iteration
nl80211: Authenticate (ifindex=14)
  * bssid=00:24:01:6f:15:3f
  * freq=2437
  * SSID - hexdump_ascii(len=7):
     6f 61 6b 6d 6f 72 65                              oakmore
  * IEs - hexdump(len=0): [NULL]
  * Auth Type 0
nl80211: Authentication request send successfully
wlan0: SME: Authentication timeout
wpa_driver_nl80211_deauthenticate(addr=00:24:01:6f:15:3f reason_code=3)

which seems to me like wpa_supplicant is trying to connect and linux is not allowing it? But if something is wrong in the kernel, then I'm not sure why restarting wpa_supplicant would fix it.

I'd rather not look into the kernel if I don't have to, but based on these logs, would that be the next place to look?

Thanks,
Aaron
_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Masashi Honma | 16 Dec 10:52 2014
Picon

[PATCH] mesh: Make beacon interval configurable

Signed-off-by: Masashi Honma <masashi.honma <at> gmail.com>
---
 src/drivers/driver.h         | 1 +
 src/drivers/driver_nl80211.c | 7 +++++++
 wpa_supplicant/mesh.c        | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f94f57a..4fcc648 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
 <at>  <at>  -952,6 +952,7  <at>  <at>  struct wpa_driver_mesh_join_params {
 	const u8 *ies;
 	int ie_len;
 	int freq;
+	int beacon_int;
 	enum ht_mode ht_mode;
 	struct wpa_driver_mesh_bss_params conf;
 #define WPA_DRIVER_MESH_FLAG_USER_MPM	0x00000001
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a7a536d..f6d5507 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
 <at>  <at>  -7769,6 +7769,13  <at>  <at>  wpa_driver_nl80211_join_mesh(void *priv,
 			goto fail;
 	}

+	if (params->beacon_int > 0) {
+		wpa_printf(MSG_DEBUG, "  * beacon_int=%d", params->beacon_int);
+		if (nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
+				params->beacon_int))
+			goto fail;
+	}
+
 	wpa_printf(MSG_DEBUG, "  * flags=%08X", params->flags);

 	container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP);
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 68187e0..7adfa63 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
 <at>  <at>  -319,6 +319,10  <at>  <at>  int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
 	params.meshid = ssid->ssid;
 	params.meshid_len = ssid->ssid_len;
 	params.freq = ssid->frequency;
+	if (ssid->beacon_int > 0)
+		params.beacon_int = ssid->beacon_int;
+	else if (wpa_s->conf->beacon_int > 0)
+		params.beacon_int = wpa_s->conf->beacon_int;
 #ifdef CONFIG_IEEE80211N
 	params.ht_mode = ssid->mesh_ht_mode;
 #endif /* CONFIG_IEEE80211N */
--

-- 
1.9.1

Gmane