mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
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:
parent
0ada5a4263
commit
97f0ffdb42
10
ChangeLog
10
ChangeLog
|
@ -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>
|
2008-05-23 Tambet Ingo <tambet@gmail.com>
|
||||||
|
|
||||||
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS
|
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <netinet/ether.h>
|
||||||
#include <dbus/dbus-glib.h>
|
#include <dbus/dbus-glib.h>
|
||||||
|
|
||||||
#include "nm-supplicant-config.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;
|
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
|
gboolean
|
||||||
nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
|
nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
|
||||||
NMSettingWireless * setting,
|
NMSettingWireless * setting,
|
||||||
|
@ -383,14 +387,18 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
|
||||||
return FALSE;
|
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",
|
if (!nm_supplicant_config_add_option (self, "bssid",
|
||||||
(char *) setting->bssid->data,
|
str_bssid, strlen (str_bssid),
|
||||||
setting->bssid->len,
|
FALSE)) {
|
||||||
FALSE)) {
|
g_free (str_bssid);
|
||||||
nm_warning ("Error adding BSSID to supplicant config.");
|
nm_warning ("Error adding BSSID to supplicant config.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
g_free (str_bssid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: band & channel config items
|
// FIXME: band & channel config items
|
||||||
|
|
|
@ -83,7 +83,7 @@ const char * phase2_allowed[] = {"auth=PAP", "auth=CHAP", "auth=MSCHAP",
|
||||||
|
|
||||||
static const struct Opt opt_table[] = {
|
static const struct Opt opt_table[] = {
|
||||||
{ "ssid", TYPE_BYTES, 0, 32,FALSE, NULL },
|
{ "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 },
|
{ "scan_ssid", TYPE_INT, 0, 1, FALSE, NULL },
|
||||||
{ "mode", TYPE_INT, 0, 1, FALSE, NULL },
|
{ "mode", TYPE_INT, 0, 1, FALSE, NULL },
|
||||||
{ "frequency", TYPE_INT, 2412, 5825, 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 (opt != NULL, FALSE);
|
||||||
g_return_val_if_fail (value != NULL, FALSE);
|
g_return_val_if_fail (value != NULL, FALSE);
|
||||||
|
|
||||||
|
/* Allow everything */
|
||||||
|
if (!opt->str_allowed)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
candidates = g_strsplit (value, " ", 0);
|
candidates = g_strsplit (value, " ", 0);
|
||||||
if (!candidates)
|
if (!candidates)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in a new issue