2006-06-19 Dan Williams <dcbw@redhat.com>

* src/NetworkManagerAP.c
		- Clarify usage of user_created

	* src/nm-ap-security-wep.c
	  src/nm-ap-security-wpa-eap.c
	  src/nm-ap-security-wpa-psk.c
	  src/nm-ap-security.c
	  src/nm-ap-security.h
		- s/user_created/adhoc, because we really do mean adhoc

	Patch from Bernard Blackham <bernard@blackham.com.au>
	* src/nm-device-802-11-wireless.c
		- (supplicant_send_network_config): instead of user_created,
			use adhoc, and do AP_SCAN 2 for adhoc networks


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1846 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-06-20 02:24:57 +00:00
parent 2f83566a03
commit e16831d1a4
8 changed files with 42 additions and 19 deletions

View file

@ -1,3 +1,20 @@
2006-06-19 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerAP.c
- Clarify usage of user_created
* src/nm-ap-security-wep.c
src/nm-ap-security-wpa-eap.c
src/nm-ap-security-wpa-psk.c
src/nm-ap-security.c
src/nm-ap-security.h
- s/user_created/adhoc, because we really do mean adhoc
Patch from Bernard Blackham <bernard@blackham.com.au>
* src/nm-device-802-11-wireless.c
- (supplicant_send_network_config): instead of user_created,
use adhoc, and do AP_SCAN 2 for adhoc networks
2006-06-15 Robert Love <rml@novell.com>
* gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the Gconf keys unless

View file

@ -47,7 +47,12 @@ struct NMAccessPoint
gboolean invalid;
gboolean artificial; /* Whether or not the AP is from a scan */
gboolean broadcast; /* Whether or not the AP is broadcasting (hidden) */
gboolean user_created; /* Whether or not the AP was created by the user with "Create network..." */
gboolean user_created; /* Whether or not the AP was created
* by the user with "Create network..."
* A subset of Ad-Hoc mode. user_created
* implies Ad-Hoc, but not necessarily
* the other way around.
*/
GTimeVal last_seen; /* Last time the AP was seen in a scan */
/* Things from user prefs/NetworkManagerInfo */

View file

@ -115,7 +115,7 @@ static gboolean
real_write_supplicant_config (NMAPSecurity *instance,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created)
gboolean adhoc)
{
gboolean success = FALSE;
char * msg = NULL;

View file

@ -169,7 +169,7 @@ static gboolean
real_write_supplicant_config (NMAPSecurity *instance,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created)
gboolean adhoc)
{
NMAPSecurityWPA_EAP * self = NM_AP_SECURITY_WPA_EAP (instance);
gboolean success = FALSE;

View file

@ -134,7 +134,7 @@ static gboolean
real_write_supplicant_config (NMAPSecurity *instance,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created)
gboolean adhoc)
{
NMAPSecurityWPA_PSK * self = NM_AP_SECURITY_WPA_PSK (instance);
gboolean success = FALSE;
@ -161,7 +161,7 @@ real_write_supplicant_config (NMAPSecurity *instance,
}
/* Ad-Hoc has to be WPA-NONE */
if (user_created)
if (adhoc)
key_mgmt = "WPA-NONE";
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
@ -189,7 +189,7 @@ real_write_supplicant_config (NMAPSecurity *instance,
pairwise_cipher = group_cipher = "NONE";
/* Ad-Hoc requires pairwise cipher of NONE */
if (user_created)
if (adhoc)
pairwise_cipher = "NONE";
/* If user selected "Automatic", we let wpa_supplicant sort it out */

View file

@ -155,7 +155,7 @@ gboolean
nm_ap_security_write_supplicant_config (NMAPSecurity *self,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created)
gboolean adhoc)
{
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (ctrl != NULL, FALSE);
@ -164,7 +164,8 @@ nm_ap_security_write_supplicant_config (NMAPSecurity *self,
if (self->priv->dispose_has_run)
return FALSE;
return NM_AP_SECURITY_GET_CLASS (self)->write_supplicant_config_func (self, ctrl, nwid, user_created);
return NM_AP_SECURITY_GET_CLASS (self)->write_supplicant_config_func (self,
ctrl, nwid, adhoc);
}
void
@ -222,7 +223,7 @@ static gboolean
real_write_supplicant_config (NMAPSecurity *self,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created)
gboolean adhoc)
{
/* Unencrypted network setup */
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,

View file

@ -67,7 +67,7 @@ struct _NMAPSecurityClass
gboolean (*write_supplicant_config_func)(NMAPSecurity *self,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created);
gboolean adhoc);
guint32 (*get_default_capabilities_func)(NMAPSecurity *self);
};
@ -93,7 +93,7 @@ int nm_ap_security_serialize (NMAPSecurity *self,
gboolean nm_ap_security_write_supplicant_config (NMAPSecurity *self,
struct wpa_ctrl *ctrl,
int nwid,
gboolean user_created);
gboolean adhoc);
const char * nm_ap_security_get_description (NMAPSecurity *self);

View file

@ -2768,7 +2768,7 @@ supplicant_send_network_config (NMDevice80211Wireless *self,
int nwid;
const char * essid;
struct wpa_ctrl * ctrl;
gboolean user_created;
gboolean is_adhoc;
const char * hex_essid;
const char * ap_scan = "AP_SCAN 1";
guint32 caps;
@ -2792,11 +2792,11 @@ supplicant_send_network_config (NMDevice80211Wireless *self,
|| (caps & NM_802_11_CAP_PROTO_WPA2);
/* Use "AP_SCAN 2" if:
* - The wireless network is non-broadcast or user created
* - The wireless driver does not support WPA
* - The wireless network is non-broadcast or Ad-Hoc
* - The wireless driver does not support WPA (stupid drivers...)
*/
user_created = nm_ap_get_user_created (ap);
if (!nm_ap_get_broadcast (ap) || user_created || !supports_wpa)
is_adhoc = (nm_ap_get_mode(ap) == IW_MODE_ADHOC);
if (!nm_ap_get_broadcast (ap) || is_adhoc || !supports_wpa)
ap_scan = "AP_SCAN 2";
/* Tell wpa_supplicant that we'll do the scanning */
@ -2829,7 +2829,7 @@ supplicant_send_network_config (NMDevice80211Wireless *self,
/* For non-broadcast networks, we need to set "scan_ssid 1" to scan with probe request frames.
* However, don't try to probe Ad-Hoc networks.
*/
if (!nm_ap_get_broadcast (ap) && !user_created)
if (!nm_ap_get_broadcast (ap) && !is_adhoc)
{
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
"SET_NETWORK %i scan_ssid 1", nwid))
@ -2837,7 +2837,7 @@ supplicant_send_network_config (NMDevice80211Wireless *self,
}
/* Ad-Hoc ? */
if (user_created)
if (is_adhoc)
{
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
"SET_NETWORK %i mode 1", nwid))
@ -2847,7 +2847,7 @@ supplicant_send_network_config (NMDevice80211Wireless *self,
if (nm_device_activation_should_cancel (NM_DEVICE (self)))
goto out;
if (!nm_ap_security_write_supplicant_config (nm_ap_get_security (ap), ctrl, nwid, user_created))
if (!nm_ap_security_write_supplicant_config (nm_ap_get_security (ap), ctrl, nwid, is_adhoc))
goto out;
if (nm_device_activation_should_cancel (NM_DEVICE (self)))