diff options
| author | Jiří Klimeš <jklimes@redhat.com> | 2012-04-02 12:28:05 +0200 |
|---|---|---|
| committer | Jiří Klimeš <jklimes@redhat.com> | 2012-04-02 12:57:30 +0200 |
| commit | 47f9eb80d81c5e4a2761e1507ba47ce8bae493db (patch) | |
| tree | aca40788e4673d2c5e46f936db4c85e0fe0d3ff5 | |
| parent | 02482101ffd8ef2d8acec6f968449a38cc218b49 (diff) | |
core: call is_adhoc_wpa() only after we check '802-11-wireless' setting
This prevents assertion while checking a connection that is not a wireless one.
| -rw-r--r-- | src/nm-device-wifi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index ed964a5768..429983b718 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1014,14 +1014,6 @@ real_check_connection_compatible (NMDevice *device, const GByteArray *mac; const GSList *mac_blacklist, *mac_blacklist_iter; - if (is_adhoc_wpa (connection)) { - g_set_error_literal (error, - NM_WIFI_ERROR, - NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, - "WPA Ad-Hoc disabled due to kernel bugs"); - return FALSE; - } - s_con = nm_connection_get_setting_connection (connection); g_assert (s_con); @@ -1040,6 +1032,7 @@ real_check_connection_compatible (NMDevice *device, return FALSE; } + mac = nm_setting_wireless_get_mac_address (s_wireless); if (mac && memcmp (mac->data, &priv->perm_hw_addr, ETH_ALEN)) { g_set_error (error, @@ -1067,6 +1060,14 @@ real_check_connection_compatible (NMDevice *device, } } + if (is_adhoc_wpa (connection)) { + g_set_error_literal (error, + NM_WIFI_ERROR, + NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, + "WPA Ad-Hoc disabled due to kernel bugs"); + return FALSE; + } + // FIXME: check channel/freq/band against bands the hardware supports // FIXME: check encryption against device capabilities // FIXME: check bitrate against device capabilities |
