Commit f249956c authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

supplicant-config: add support for joining a Mesh

parent 67797338
......@@ -458,7 +458,7 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
GError **error)
{
NMSupplicantConfigPrivate *priv;
gboolean is_adhoc, is_ap;
gboolean is_adhoc, is_ap, is_mesh;
const char *mode, *band;
guint32 channel;
GBytes *ssid;
......@@ -473,6 +473,7 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
mode = nm_setting_wireless_get_mode (setting);
is_adhoc = (mode && !strcmp (mode, "adhoc")) ? TRUE : FALSE;
is_ap = (mode && !strcmp (mode, "ap")) ? TRUE : FALSE;
is_mesh = (mode && !strcmp (mode, "mesh")) ? TRUE : FALSE;
if (is_adhoc || is_ap)
priv->ap_scan = 2;
else
......@@ -502,7 +503,12 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
return FALSE;
}
if ((is_adhoc || is_ap) && fixed_freq) {
if (is_mesh) {
if (!nm_supplicant_config_add_option (self, "mode", "5", -1, NULL, error))
return FALSE;
}
if ((is_adhoc || is_ap || is_mesh) && fixed_freq) {
gs_free char *str_freq = NULL;
str_freq = g_strdup_printf ("%u", fixed_freq);
......@@ -510,10 +516,10 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
return FALSE;
}
/* Except for Ad-Hoc and Hotspot, request that the driver probe for the
/* Except for Ad-Hoc, Hotspot and Mesh, request that the driver probe for the
* specific SSID we want to associate with.
*/
if (!(is_adhoc || is_ap)) {
if (!(is_adhoc || is_ap || is_mesh)) {
if (!nm_supplicant_config_add_option (self, "scan_ssid", "1", -1, NULL, error))
return FALSE;
}
......
......@@ -93,7 +93,6 @@ static const struct Opt opt_table[] = {
{ "ssid", TYPE_BYTES, 0, 32,FALSE, NULL },
{ "bssid", TYPE_KEYWORD, 0, 0, FALSE, NULL },
{ "scan_ssid", TYPE_INT, 0, 1, FALSE, NULL },
{ "mode", TYPE_INT, 0, 2, FALSE, NULL },
{ "frequency", TYPE_INT, 2412, 5825, FALSE, NULL },
{ "auth_alg", TYPE_KEYWORD, 0, 0, FALSE, auth_alg_allowed },
{ "psk", TYPE_BYTES, 0, 0, FALSE, NULL },
......@@ -254,6 +253,12 @@ nm_supplicant_settings_verify_setting (const char * key,
g_return_val_if_fail (key != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
if (strcmp (key, "mode") == 0) {
if (strcmp (value, "1") && strcmp (value, "2") && strcmp (value, "5"))
return TYPE_INVALID;
return TYPE_INT;
}
for (i = 0; i < opt_count; i++) {
if (strcmp (opt_table[i].key, key) != 0)
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment