summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-12-11 19:20:19 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-12-11 19:21:54 +0100
commitc48a6457f851f24b07c384007bb471dafcd0ef14 (patch)
tree1ae177ef5767e1437b63a4da0ae231aa3c858a2f
parentc317cccbef29bc4ec441ee89778f763618c5b4b4 (diff)
wireless: fix handling of wdev->config_state, prevent handling of multiple state changes (reload + remove)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--wireless.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/wireless.c b/wireless.c
index 3460337..a4d7c26 100644
--- a/wireless.c
+++ b/wireless.c
@@ -281,10 +281,10 @@ wdev_handle_config_change(struct wireless_device *wdev)
{
enum interface_config_state state = wdev->config_state;
- wdev->config_state = IFC_NORMAL;
switch(state) {
case IFC_NORMAL:
case IFC_RELOAD:
+ wdev->config_state = IFC_NORMAL;
if (wdev->autostart)
__wireless_device_set_up(wdev);
break;
@@ -395,12 +395,10 @@ wireless_device_set_down(struct wireless_device *wdev)
static void
wdev_set_config_state(struct wireless_device *wdev, enum interface_config_state s)
{
- enum interface_config_state old_state = wdev->config_state;
-
- wdev->config_state = s;
- if (old_state != IFC_NORMAL)
+ if (wdev->config_state != IFC_NORMAL)
return;
+ wdev->config_state = s;
if (wdev->state == IFS_DOWN)
wdev_handle_config_change(wdev);
else