summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-09-20 12:54:14 -0500
committerDan Williams <dcbw@redhat.com>2012-09-20 12:54:14 -0500
commit6d5c5f936d869c28e23ad7a45defbab5e74b8363 (patch)
tree1840034949e5747189c615c27fab8ead063cce50
parente6a648a9692f028710269afdd659bcca8c5854e1 (diff)
downloadNetworkManager-6d5c5f936d869c28e23ad7a45defbab5e74b8363.tar.gz
Revert "wifi: disable Ad-Hoc WPA connections (lp:905748)"
This reverts commit 69247a00eacd00617acbf1dfcee8497437b8ad39. We'll enable RSN IBSS, which isn't broken.
-rw-r--r--libnm-util/nm-utils.c4
-rw-r--r--src/nm-device-wifi.c52
-rw-r--r--src/settings/nm-settings.c45
3 files changed, 0 insertions, 101 deletions
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index 7f157217b5..8c485d3145 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -1317,8 +1317,6 @@ nm_utils_wifi_security_valid (NMUtilsSecurityType type,
}
break;
case NMU_SEC_WPA_PSK:
- if (adhoc)
- return FALSE; /* FIXME: Kernel WPA Ad-Hoc support is buggy */
if (!(wifi_caps & NM_WIFI_DEVICE_CAP_WPA))
return FALSE;
if (flags_valid) {
@@ -1345,8 +1343,6 @@ nm_utils_wifi_security_valid (NMUtilsSecurityType type,
}
break;
case NMU_SEC_WPA2_PSK:
- if (adhoc)
- return FALSE; /* FIXME: Kernel WPA Ad-Hoc support is buggy */
if (!(wifi_caps & NM_WIFI_DEVICE_CAP_RSN))
return FALSE;
if (flags_valid) {
diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c
index b3d1032d83..7108a10a5f 100644
--- a/src/nm-device-wifi.c
+++ b/src/nm-device-wifi.c
@@ -989,36 +989,6 @@ real_deactivate (NMDevice *dev)
}
static gboolean
-is_adhoc_wpa (NMConnection *connection)
-{
- NMSettingWireless *s_wifi;
- NMSettingWirelessSecurity *s_wsec;
- const char *mode, *key_mgmt;
-
- /* The kernel doesn't support Ad-Hoc WPA connections well at this time,
- * and turns them into open networks. It's been this way since at least
- * 2.6.30 or so; until that's fixed, disable WPA-protected Ad-Hoc networks.
- */
-
- s_wifi = nm_connection_get_setting_wireless (connection);
- g_return_val_if_fail (s_wifi != NULL, FALSE);
-
- mode = nm_setting_wireless_get_mode (s_wifi);
- if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_ADHOC) != 0)
- return FALSE;
-
- s_wsec = nm_connection_get_setting_wireless_security (connection);
- if (!s_wsec)
- return FALSE;
-
- key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
- if (g_strcmp0 (key_mgmt, "wpa-none") != 0)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
real_check_connection_compatible (NMDevice *device,
NMConnection *connection,
GError **error)
@@ -1293,18 +1263,6 @@ real_complete_connection (NMDevice *device,
return FALSE;
}
- /* The kernel doesn't support Ad-Hoc WPA connections well at this time,
- * and turns them into open networks. It's been this way since at least
- * 2.6.30 or so; until that's fixed, disable WPA-protected Ad-Hoc networks.
- */
- if (is_adhoc_wpa (connection)) {
- g_set_error_literal (error,
- NM_SETTING_WIRELESS_ERROR,
- NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
- "WPA Ad-Hoc disabled due to kernel bugs");
- return FALSE;
- }
-
g_assert (ssid);
str_ssid = nm_utils_ssid_to_utf8 (ssid);
format = g_strdup_printf ("%s %%d", str_ssid);
@@ -2865,16 +2823,6 @@ real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
}
g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_MODE);
- /* The kernel doesn't support Ad-Hoc WPA connections well at this time,
- * and turns them into open networks. It's been this way since at least
- * 2.6.30 or so; until that's fixed, disable WPA-protected Ad-Hoc networks.
- */
- if (is_adhoc_wpa (connection)) {
- nm_log_warn (LOGD_WIFI, "Ad-Hoc WPA disabled due to kernel bugs");
- *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED;
- return NM_ACT_STAGE_RETURN_FAILURE;
- }
-
/* Set spoof MAC to the interface */
cloned_mac = nm_setting_wireless_get_cloned_mac_address (s_wireless);
if (cloned_mac && (cloned_mac->len == ETH_ALEN))
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index ea0ff31a5d..70d8b5cd84 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -1066,38 +1066,6 @@ add_cb (NMSettings *self,
dbus_g_method_return (context, nm_connection_get_path (NM_CONNECTION (connection)));
}
-/* FIXME: remove if/when kernel supports adhoc wpa */
-static gboolean
-is_adhoc_wpa (NMConnection *connection)
-{
- NMSettingWireless *s_wifi;
- NMSettingWirelessSecurity *s_wsec;
- const char *mode, *key_mgmt;
-
- /* The kernel doesn't support Ad-Hoc WPA connections well at this time,
- * and turns them into open networks. It's been this way since at least
- * 2.6.30 or so; until that's fixed, disable WPA-protected Ad-Hoc networks.
- */
-
- s_wifi = nm_connection_get_setting_wireless (connection);
- if (!s_wifi)
- return FALSE;
-
- mode = nm_setting_wireless_get_mode (s_wifi);
- if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_ADHOC) != 0)
- return FALSE;
-
- s_wsec = nm_connection_get_setting_wireless_security (connection);
- if (!s_wsec)
- return FALSE;
-
- key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
- if (g_strcmp0 (key_mgmt, "wpa-none") != 0)
- return FALSE;
-
- return TRUE;
-}
-
void
nm_settings_add_connection (NMSettings *self,
NMConnection *connection,
@@ -1125,19 +1093,6 @@ nm_settings_add_connection (NMSettings *self,
return;
}
- /* The kernel doesn't support Ad-Hoc WPA connections well at this time,
- * and turns them into open networks. It's been this way since at least
- * 2.6.30 or so; until that's fixed, disable WPA-protected Ad-Hoc networks.
- */
- if (is_adhoc_wpa (connection)) {
- error = g_error_new_literal (NM_SETTINGS_ERROR,
- NM_SETTINGS_ERROR_INVALID_CONNECTION,
- "WPA Ad-Hoc disabled due to kernel bugs");
- callback (self, NULL, error, context, user_data);
- g_error_free (error);
- return;
- }
-
/* Do any of the plugins support adding? */
if (!get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,