mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 23:30:13 +01:00
device/wifi: drop messing with wpa-supplicant's support for MAC address randomization
We no longer use wpa_supplicant for MAC address randomization. Instead, NetworkManager handles 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 supplicant has a PreassocMacAddr property. As this is a recent feature, the left-over code wasn't noticed until now. https://mail.gnome.org/archives/networkmanager-list/2017-February/msg00003.html Fixes:767abfa690(cherry picked from commit0cb85f161e) (cherry picked from commit7ada0e0bc3)
This commit is contained in:
parent
3ddc18bb55
commit
e7ce496166
1 changed files with 2 additions and 82 deletions
|
|
@ -73,7 +73,6 @@ typedef struct {
|
|||
bool fast_supported;
|
||||
gboolean has_credreq; /* Whether querying 802.1x credentials is supported */
|
||||
NMSupplicantFeature ap_support; /* Lightweight AP mode support */
|
||||
NMSupplicantFeature mac_randomization_support;
|
||||
guint32 max_scan_ssids;
|
||||
guint32 ready_count;
|
||||
|
||||
|
|
@ -503,25 +502,6 @@ nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
|
|||
priv->ap_support = ap_support;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
@ -546,24 +526,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);
|
||||
|
|
@ -774,8 +736,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
|
||||
|
|
@ -1194,33 +1155,6 @@ add_network (NMSupplicantInterface *self)
|
|||
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 interface: %s",
|
||||
error->message);
|
||||
emit_error_helper (self, error);
|
||||
return;
|
||||
}
|
||||
|
||||
_LOGT ("config: set MAC randomization to 0");
|
||||
add_network (self);
|
||||
}
|
||||
|
||||
static void
|
||||
set_ap_scan_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
|
|
@ -1247,21 +1181,7 @@ set_ap_scan_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
|||
_LOGI ("config: set interface ap_scan to %d",
|
||||
nm_supplicant_config_get_ap_scan (priv->cfg));
|
||||
|
||||
if (priv->mac_randomization_support == NM_SUPPLICANT_FEATURE_YES) {
|
||||
/* Enable/disable association MAC address randomization */
|
||||
g_dbus_proxy_call (priv->iface_proxy,
|
||||
DBUS_INTERFACE_PROPERTIES ".Set",
|
||||
g_variant_new ("(ssv)",
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"MacAddr",
|
||||
g_variant_new_string ("0")),
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
priv->assoc_cancellable,
|
||||
(GAsyncReadyCallback) set_mac_randomization_cb,
|
||||
self);
|
||||
} else
|
||||
add_network (self);
|
||||
add_network (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue