2008-05-23 Dan Williams <dcbw@redhat.com>

* src/supplicant-manager/nm-supplicant-settings-verify.c
		- Switch 'bssid' from bytes to keyword type
		- (validate_type_keyword): allow NULL keyword lists

	* src/supplicant-manager/nm-supplicant-config.c
		- (nm_supplicant_config_add_setting_wireless): convert the bssid from
			a byte array to string form, which is what the supplicant expects



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3686 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-05-23 10:23:17 +00:00
parent 0ada5a4263
commit 97f0ffdb42
3 changed files with 27 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2008-05-23 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/nm-supplicant-settings-verify.c
- Switch 'bssid' from bytes to keyword type
- (validate_type_keyword): allow NULL keyword lists
* src/supplicant-manager/nm-supplicant-config.c
- (nm_supplicant_config_add_setting_wireless): convert the bssid from
a byte array to string form, which is what the supplicant expects
2008-05-23 Tambet Ingo <tambet@gmail.com>
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS

View file

@ -22,6 +22,7 @@
#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
#include "nm-supplicant-config.h"
@ -323,6 +324,9 @@ nm_supplicant_config_get_blobs (NMSupplicantConfig * self)
return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->blobs;
}
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((guint8*)(x))[0],((guint8*)(x))[1],((guint8*)(x))[2],((guint8*)(x))[3],((guint8*)(x))[4],((guint8*)(x))[5]
gboolean
nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
NMSettingWireless * setting,
@ -383,14 +387,18 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
return FALSE;
}
if (setting->bssid) {
if (setting->bssid && setting->bssid->len) {
char *str_bssid;
str_bssid = g_strdup_printf (MAC_FMT, MAC_ARG (setting->bssid->data));
if (!nm_supplicant_config_add_option (self, "bssid",
(char *) setting->bssid->data,
setting->bssid->len,
FALSE)) {
str_bssid, strlen (str_bssid),
FALSE)) {
g_free (str_bssid);
nm_warning ("Error adding BSSID to supplicant config.");
return FALSE;
}
g_free (str_bssid);
}
// FIXME: band & channel config items

View file

@ -83,7 +83,7 @@ const char * phase2_allowed[] = {"auth=PAP", "auth=CHAP", "auth=MSCHAP",
static const struct Opt opt_table[] = {
{ "ssid", TYPE_BYTES, 0, 32,FALSE, NULL },
{ "bssid", TYPE_BYTES, 0, 6, FALSE, NULL },
{ "bssid", TYPE_KEYWORD, 0, 0, FALSE, NULL },
{ "scan_ssid", TYPE_INT, 0, 1, FALSE, NULL },
{ "mode", TYPE_INT, 0, 1, FALSE, NULL },
{ "frequency", TYPE_INT, 2412, 5825, FALSE, NULL },
@ -177,6 +177,10 @@ validate_type_keyword (const struct Opt * opt,
g_return_val_if_fail (opt != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
/* Allow everything */
if (!opt->str_allowed)
return TRUE;
candidates = g_strsplit (value, " ", 0);
if (!candidates)
goto out;