diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-08-13 16:11:55 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-08-13 16:11:55 +0000 |
commit | 486e72a79bfcfc9000ae0b4ed4d847522b5ce04e (patch) | |
tree | d8bd375f336c6b662f3916394c689ea40f3589c7 /src/waproamd.c | |
parent | 385d3e53254fcd390c3596f2ccdcc65cd9310757 (diff) |
Serveral fixes
git-svn-id: file:///home/lennart/svn/public/aeswepd/trunk@6 022f378f-78c4-0310-b860-d162c87e6274
Diffstat (limited to 'src/waproamd.c')
-rw-r--r-- | src/waproamd.c | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/src/waproamd.c b/src/waproamd.c index 7c8d7d8..f96288a 100644 --- a/src/waproamd.c +++ b/src/waproamd.c @@ -69,8 +69,8 @@ int issue_scan(struct interface *i) { if (iw_set_mode(i, IW_MODE_INFRA) < 0) return -1; - if (iw_set_ap(i, &null_ap) < 0) - return -1; +/* if (iw_set_ap(i, &null_ap) < 0) */ +/* return -1; */ if (iw_set_essid(i, NULL) < 0) return -1; @@ -327,7 +327,7 @@ int go(struct interface *i) { if (nlapi_work(0) < 0) goto finish; - if (!use_assocwatch) { + if (!disabled && !use_assocwatch) { if ((associated = interface_is_assoc(i, &associated_ap)) < 0) { if (!use_ifmonitor) goto finish; @@ -341,51 +341,51 @@ int go(struct interface *i) { daemon_log(LOG_INFO, "Interface disabled\n"); if (associated) - if (set_current_ap(&null_ap) < 0) + if (set_current_ap(NULL) < 0) goto finish; - associated = 0; + associated = scanning = 0; } /* Changed: disabled -> enabled */ if (d && !disabled) { daemon_log(LOG_INFO, "Interface enabled\n"); - associated = 0; + associated = scanning = 0; } - if (!disabled) { - /* Changed: associated -> not associated */ - if (a && !associated) - daemon_log(LOG_INFO, "No longer associated.\n"); + /* Changed: associated -> not associated */ + if (a && !associated) { + daemon_log(LOG_INFO, "No longer associated.\n"); + scanning = 0; + } - /* Changed: not associated -> associated */ - if (!a && associated) { - if (set_current_ap(&associated_ap) < 0) - goto finish; + /* Changed: not associated -> associated */ + if (!a && associated) { + if (set_current_ap(&associated_ap) < 0) + goto finish; - daemon_log(LOG_INFO, "Associated.\n"); - next_scan = (time_t) -1; - } + daemon_log(LOG_INFO, "Associated.\n"); + scanning = 0; + } - if (scanning) { - int r; - struct ap_info *ai = NULL; + if (scanning) { + int r; + struct ap_info *ai = NULL; - if ((r = read_scan(i, &ai)) < 0) { - if (!use_ifmonitor) - goto finish; - - scanning = 0; - - } else if (!r) { - - scanning = 0; + if ((r = read_scan(i, &ai)) < 0) { + if (!use_ifmonitor) + goto finish; + + scanning = 0; + + } else if (!r) { + + scanning = 0; + + if (!associated) { - if (!associated) { - - if (set_current_ap(ai ? &ai->ap : NULL) < 0) - goto finish; - } + if (set_current_ap(ai ? &ai->ap : NULL) < 0) + goto finish; } } } @@ -432,6 +432,8 @@ int go(struct interface *i) { finish: + set_current_ap(NULL); + if (send_retval && daemonize && wait_on_fork) daemon_retval_send(1); |