Re: [PATCH 1/1] device/wifi: drop messing with wpa-supplicant's support for MAC address randomization

2017-02-07 Thread Thomas Haller
On Tue, 2017-02-07 at 11:29 +0100, Beniamino Galvani wrote:
> On Sun, Feb 05, 2017 at 11:18:08PM +0100, Thomas Haller wrote:
> > We no longer use wpa_supplicant for MAC address randomization.
> > Instead, NetworkManager
> > handle it on it's own. It is actually important that supplicant
> > does not interfere
> > when setting the MAC address of the device.
> > 
> > The code was only in effect when a PreassocMacAddr property exists,
> > which is a recent feature so this wasn't unnoticed until now.
> > 
> > Fixes: 767abfa69040c62ae1dc0989a77df8c5e0e489c1
> 
> Looks good to me.
> 
> Beniamino

Thanks.

merged: 
https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0cb85f161ea332dc400d7e33071ca1f3dfafd730

Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH 1/1] device/wifi: drop messing with wpa-supplicant's support for MAC address randomization

2017-02-07 Thread Beniamino Galvani
On Sun, Feb 05, 2017 at 11:18:08PM +0100, Thomas Haller wrote:
> We no longer use wpa_supplicant for MAC address randomization. Instead, 
> NetworkManager
> handle it on it's own. It is actually important that supplicant does not 
> interfere
> when setting the MAC address of the device.
> 
> The code was only in effect when a PreassocMacAddr property exists,
> which is a recent feature so this wasn't unnoticed until now.
> 
> Fixes: 767abfa69040c62ae1dc0989a77df8c5e0e489c1

Looks good to me.

Beniamino


signature.asc
Description: PGP signature
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH 1/1] device/wifi: drop messing with wpa-supplicant's support for MAC address randomization

2017-02-05 Thread Thomas Haller
We no longer use wpa_supplicant for MAC address randomization. Instead, 
NetworkManager
handle it on it's own. It is actually important that supplicant does not 
interfere
when setting the MAC address of the device.

The code was only in effect when a PreassocMacAddr property exists,
which is a recent feature so this wasn't unnoticed until now.

Fixes: 767abfa69040c62ae1dc0989a77df8c5e0e489c1
---
 src/supplicant/nm-supplicant-interface.c | 84 +---
 1 file changed, 2 insertions(+), 82 deletions(-)

diff --git a/src/supplicant/nm-supplicant-interface.c 
b/src/supplicant/nm-supplicant-interface.c
index deaac77..c913a69 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -67,7 +67,6 @@ typedef struct {
gboolean   has_credreq;  /* Whether querying 802.1x credentials is 
supported */
NMSupplicantFeature fast_support;
NMSupplicantFeature ap_support;   /* Lightweight AP mode support */
-   NMSupplicantFeature mac_randomization_support;
guint32max_scan_ssids;
guint32ready_count;
 
@@ -520,25 +519,6 @@ nm_supplicant_interface_set_fast_support 
(NMSupplicantInterface *self,
 }
 
 static void
-set_preassoc_scan_mac_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer 
user_data)
-{
-   NMSupplicantInterface *self;
-   gs_unref_variant GVariant *variant = NULL;
-   gs_free_error GError *error = NULL;
-
-   variant = _nm_dbus_proxy_call_finish (proxy, result,
- G_VARIANT_TYPE ("()"),
- );
-   if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
-   return;
-
-   self = NM_SUPPLICANT_INTERFACE (user_data);
-   if (error)
-   _LOGW ("failed to enable scan MAC address randomization (%s)", 
error->message);
-   iface_check_ready (self);
-}
-
-static void
 iface_introspect_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer 
user_data)
 {
NMSupplicantInterface *self;
@@ -562,24 +542,6 @@ iface_introspect_cb (GDBusProxy *proxy, GAsyncResult 
*result, gpointer user_data
/* The ProbeRequest method only exists if AP mode has been 
enabled */
if (strstr (data, "ProbeRequest"))
priv->ap_support = NM_SUPPLICANT_FEATURE_YES;
-
-   if (strstr (data, "PreassocMacAddr")) {
-   priv->mac_randomization_support = 
NM_SUPPLICANT_FEATURE_YES;
-
-   /* Turn on MAC randomization during scans by default */
-   priv->ready_count++;
-   g_dbus_proxy_call (priv->iface_proxy,
-  DBUS_INTERFACE_PROPERTIES ".Set",
-  g_variant_new ("(ssv)",
- 
WPAS_DBUS_IFACE_INTERFACE,
- "PreassocMacAddr",
- g_variant_new_string 
("0")),
-  G_DBUS_CALL_FLAGS_NONE,
-  -1,
-  priv->init_cancellable,
-  (GAsyncReadyCallback) 
set_preassoc_scan_mac_cb,
-  self);
-   }
}
 
iface_check_ready (self);
@@ -790,8 +752,7 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult 
*result, gpointer user_
   (GAsyncReadyCallback) iface_check_netreply_cb,
   self);
 
-   if (priv->ap_support == NM_SUPPLICANT_FEATURE_UNKNOWN ||
-   priv->mac_randomization_support == NM_SUPPLICANT_FEATURE_UNKNOWN) {
+   if (priv->ap_support == NM_SUPPLICANT_FEATURE_UNKNOWN) {
/* If the global supplicant capabilities property is not 
present, we can
 * fall back to checking whether the ProbeRequest method is 
supported.  If
 * neither of these works we have no way of determining if AP 
mode is
@@ -1226,33 +1187,6 @@ add_network (NMSupplicantInterface *self)
 }
 
 static void
-set_mac_randomization_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer 
user_data)
-{
-   NMSupplicantInterface *self;
-   NMSupplicantInterfacePrivate *priv;
-   gs_unref_variant GVariant *reply = NULL;
-   gs_free_error GError *error = NULL;
-
-   reply = g_dbus_proxy_call_finish (proxy, result, );
-   if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
-   return;
-
-   self = NM_SUPPLICANT_INTERFACE (user_data);
-   priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
-
-   if (!reply) {
-   g_dbus_error_strip_remote_error (error);
-   _LOGW ("couldn't send MAC randomization mode to the supplicant 
interface: