[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 ("()"),
- &error);
-   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, &error);
-   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 
in

New option parameters

2017-02-05 Thread Shawn Adams

All,


After reading the great efforts to include WOL and other parameters into
NM, I'm wondering if

there is interest in adding a few additional parameters that are
becoming more interesting

for larger enterprise users


* 802.11w MFP- wpa_supplicant -

# PMF enabled: ieee80211w=1 and key_mgmt=WPA-EAP WPA-EAP-SHA256
# PMF required: ieee80211w=2 and key_mgmt=WPA-EAP-SHA256

# pmf=1


* UAPSD- maybe difficult, chip-specific

* Power save- maybe difficult, chip-specific  iw  set
power_save off

* Opportunistic Key Caching

#okc=0

*  disable_vht: Whether VHT should be disabled.
# 0 = VHT enabled (if AP supports it)
# 1 = VHT disabled

* A clever method of enabling/disabling 802.11r

Much of this involves NM passing parameters to the wpa_supplicant.conf

And yes, granted - all predicated on the driver/NIC support where
appropriate.


I see most of these really helpful in network acceptance testing, or
proving problems with differing clients,

would be great if NM offers easy, and in some cases, scriptable
configuration which other OS make difficult.


Best Regards,







___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list