aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-03-06 09:13:50 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-06 09:13:50 (GMT)
commitaa53509ffefed41bb08ded90d9cbe67738876c7c (patch)
treeebe455e4e4667cbcca0418d191df27df967f2c1d /wpa_supplicant
parent09bd6e8cca713adc35dac214daa8d71c254a651d (diff)
downloadhostap-aa53509ffefed41bb08ded90d9cbe67738876c7c.zip
hostap-aa53509ffefed41bb08ded90d9cbe67738876c7c.tar.gz
hostap-aa53509ffefed41bb08ded90d9cbe67738876c7c.tar.bz2
Update priority list after priority change
Despite comments in the wpa_config_update_prio_list(struct wpa_config *config) telling that it is called "if priority for a network is changed", it is apparently not. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/config.c2
-rw-r--r--wpa_supplicant/config.h1
-rw-r--r--wpa_supplicant/ctrl_iface.c2
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c9
-rw-r--r--wpa_supplicant/dbus/dbus_old_handlers.c2
5 files changed, 13 insertions, 3 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 68c6b6e..6aa8e9b 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1543,7 +1543,7 @@ int wpa_config_add_prio_network(struct wpa_config *config,
* configuration when a network is being added or removed. This is also called
* if a priority for a network is changed.
*/
-static int wpa_config_update_prio_list(struct wpa_config *config)
+int wpa_config_update_prio_list(struct wpa_config *config)
{
struct wpa_ssid *ssid;
int ret = 0;
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 21c2fdd..754e4be 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -364,6 +364,7 @@ char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var);
void wpa_config_update_psk(struct wpa_ssid *ssid);
int wpa_config_add_prio_network(struct wpa_config *config,
struct wpa_ssid *ssid);
+int wpa_config_update_prio_list(struct wpa_config *config);
const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
const char *name);
void wpa_config_set_blob(struct wpa_config *config,
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 33a1d94..438bc27 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1092,6 +1092,8 @@ static int wpa_supplicant_ctrl_iface_set_network(
value[0] == '"' && ssid->ssid_len) ||
(os_strcmp(name, "ssid") == 0 && ssid->passphrase))
wpa_config_update_psk(ssid);
+ else if (os_strcmp(name, "priority") == 0)
+ wpa_config_update_prio_list(wpa_s->conf);
return 0;
}
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index a777d06..3e924dc 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -214,6 +214,7 @@ static struct wpa_supplicant * get_iface_by_dbus_path(
/**
* set_network_properties - Set properties of a configured network
* @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
* @ssid: wpa_ssid structure for a configured network
* @iter: DBus message iterator containing dictionary of network
* properties to set.
@@ -222,6 +223,7 @@ static struct wpa_supplicant * get_iface_by_dbus_path(
* Sets network configuration with parameters given id DBus dictionary
*/
static DBusMessage * set_network_properties(DBusMessage *message,
+ struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid,
DBusMessageIter *iter)
{
@@ -304,6 +306,8 @@ static DBusMessage * set_network_properties(DBusMessage *message,
value[0] == '"' && ssid->ssid_len) ||
(strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
wpa_config_update_psk(ssid);
+ else if (os_strcmp(entry.key, "priority") == 0)
+ wpa_config_update_prio_list(wpa_s->conf);
os_free(value);
wpa_dbus_dict_entry_clear(&entry);
@@ -1338,7 +1342,7 @@ DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message,
ssid->disabled = 1;
wpa_config_set_network_defaults(ssid);
- reply = set_network_properties(message, ssid, &iter);
+ reply = set_network_properties(message, wpa_s, ssid, &iter);
if (reply) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_add_network[dbus]:"
"control interface couldn't set network "
@@ -2911,7 +2915,8 @@ DBusMessage * wpas_dbus_setter_network_properties(
dbus_message_iter_recurse(&iter, &variant_iter);
- reply = set_network_properties(message, ssid, &variant_iter);
+ reply = set_network_properties(message, net->wpa_s, ssid,
+ &variant_iter);
if (reply)
wpa_printf(MSG_DEBUG, "dbus control interface couldn't set "
"network properties");
diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c b/wpa_supplicant/dbus/dbus_old_handlers.c
index 6527e66..ef60b8f 100644
--- a/wpa_supplicant/dbus/dbus_old_handlers.c
+++ b/wpa_supplicant/dbus/dbus_old_handlers.c
@@ -997,6 +997,8 @@ DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
value[0] == '"' && ssid->ssid_len) ||
(os_strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
wpa_config_update_psk(ssid);
+ else if (os_strcmp(entry.key, "priority") == 0)
+ wpa_config_update_prio_list(wpa_s->conf);
os_free(value);
wpa_dbus_dict_entry_clear(&entry);