[PATCH] Update priority list after changing priority
Dmitry Shmidt
dimitrysh
Wed Feb 24 10:33:23 PST 2010
Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
wpa_supplicant/config.c | 2 +-
wpa_supplicant/config.h | 1 +
wpa_supplicant/ctrl_iface.c | 4 ++++
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 89e0fba..655abc5 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1502,7 +1502,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 4484e91..bd65e5a 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -341,6 +341,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 3730064..57eb63c 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1089,6 +1089,10 @@ static int wpa_supplicant_ctrl_iface_set_network(
wpa_printf(MSG_DEBUG, "CTRL_IFACE: Failed to set network "
"variable '%s'", name);
return -1;
+ } else {
+ if (os_strcmp(name, "priority") == 0) {
+ wpa_config_update_prio_list(wpa_s->conf);
+ }
}
if (wpa_s->current_ssid == ssid) {
--
1.6.2.2
--000e0cd3f2f66efa1d04805d1ddc
Content-Type: application/octet-stream;
name="0001-Update-priority-list-after-changing-priority.patch"
Content-Disposition: attachment;
filename="0001-Update-priority-list-after-changing-priority.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g62h9v3d0
RnJvbSAxYzNkNDhjZDA3ZTgzMDEwZjAzOTE0NjE4MzM1ZjA5N2NkNGM0NTMyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBEbWl0cnkgU2htaWR0IDxkaW1pdHJ5c2hAZ29vZ2xlLmNvbT4K
RGF0ZTogV2VkLCAyNCBGZWIgMjAxMCAxMDozMzoyMyAtMDgwMApTdWJqZWN0OiBbUEFUQ0hdIFVw
ZGF0ZSBwcmlvcml0eSBsaXN0IGFmdGVyIGNoYW5naW5nIHByaW9yaXR5CgpTaWduZWQtb2ZmLWJ5
OiBEbWl0cnkgU2htaWR0IDxkaW1pdHJ5c2hAZ29vZ2xlLmNvbT4KLS0tCiB3cGFfc3VwcGxpY2Fu
dC9jb25maWcuYyAgICAgfCAgICAyICstCiB3cGFfc3VwcGxpY2FudC9jb25maWcuaCAgICAgfCAg
ICAxICsKIHdwYV9zdXBwbGljYW50L2N0cmxfaWZhY2UuYyB8ICAgIDQgKysrKwogMyBmaWxlcyBj
aGFuZ2VkLCA2IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvd3Bh
X3N1cHBsaWNhbnQvY29uZmlnLmMgYi93cGFfc3VwcGxpY2FudC9jb25maWcuYwppbmRleCA4OWUw
ZmJhLi42NTVhYmM1IDEwMDY0NAotLS0gYS93cGFfc3VwcGxpY2FudC9jb25maWcuYworKysgYi93
cGFfc3VwcGxpY2FudC9jb25maWcuYwpAQCAtMTUwMiw3ICsxNTAyLDcgQEAgaW50IHdwYV9jb25m
aWdfYWRkX3ByaW9fbmV0d29yayhzdHJ1Y3Qgd3BhX2NvbmZpZyAqY29uZmlnLAogICogY29uZmln
dXJhdGlvbiB3aGVuIGEgbmV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pZywKIAkJCQkJCSAgIGNvbnN0IGNoYXIgKm5hbWUpOwogdm9pZCB3cGFfY29u
ZmlnX3NldF9ibG9iKHN0cnVjdCB3cGFfY29uZmlnICpjb25maWcsCmRpZmYgLS1naXQgYS93cGFf
c3VwcGxpY2FudC9jdHJsX2lmYWNlLmMgYi93cGFfc3VwcGxpY2FudC9jdHJsX2lmYWNlLmMKaW5k
ZXggMzczMDA2NC4uNTdlYjYzYyAxMDA2NDQKLS0tIGEvd3BhX3N1cHBsaWNhbnQvY3RybF9pZmFj
ZS5jCisrKyBiL3dwYV9zdXBwbGljYW50L2N0cmxfaWZhY2UuYwpAQCAtMTA4OSw2ICsxMDg5LDEw
IEBAIHN0YXRpYyBpbnQgd3BhX3N1cHBsaWNhbnRfY3RybF9pZmFjZV9zZXRfbmV0d29yaygKIAkJ
d3BhX3ByaW50ZihNU0dfREVCVUcsICJDVFJMX0lGQUNFOiBGYWlsZWQgdG8gc2V0IG5ldHdvcmsg
IgogCQkJICAgInZhcmlhYmxlICclcyciLCBuYW1lKTsKIAkJcmV0dXJuIC0xOworCX0gZWxzZSB7
CisJCWlmIChvc19zdHJjbXAobmFtZSwgInByaW9yaXR5IikgPT0gMCkgeworCQkJd3BhX2NvbmZp
Z191cGRhdGVfcHJpb19saXN0KHdwYV9zLT5jb25mKTsKKwkJfQogCX0KIAogCWlmICh3cGFfcy0+
Y3VycmVudF9zc2lkID09IHNzaWQpIHsKLS0gCjEuNi4yLjIKCg==
--000e0cd3f2f66efa1d04805d1ddc--
More information about the Hostap
mailing list