projects
/
libeap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7c04d5e
)
WPS ER: Move STA entry unlinking into a separate function
author
Jouni Malinen
<j@w1.fi>
Sat, 21 Nov 2009 10:18:03 +0000
(12:18 +0200)
committer
Jouni Malinen
<j@w1.fi>
Sat, 21 Nov 2009 10:18:03 +0000
(12:18 +0200)
src/wps/wps_er.c
patch
|
blob
|
history
diff --git
a/src/wps/wps_er.c
b/src/wps/wps_er.c
index
26bac70
..
898f936
100644
(file)
--- a/
src/wps/wps_er.c
+++ b/
src/wps/wps_er.c
@@
-159,6
+159,26
@@
static void wps_er_sta_free(struct wps_er_sta *sta)
}
}
+static void wps_er_sta_unlink(struct wps_er_sta *sta)
+{
+ struct wps_er_sta *prev, *tmp;
+ struct wps_er_ap *ap = sta->ap;
+ tmp = ap->sta;
+ prev = NULL;
+ while (tmp) {
+ if (tmp == sta) {
+ if (prev)
+ prev->next = sta->next;
+ else
+ ap->sta = sta->next;
+ return;
+ }
+ prev = tmp;
+ tmp = tmp->next;
+ }
+}
+
+
static void wps_er_sta_remove_all(struct wps_er_ap *ap)
{
struct wps_er_sta *prev, *sta;
static void wps_er_sta_remove_all(struct wps_er_ap *ap)
{
struct wps_er_sta *prev, *sta;
@@
-695,22
+715,9
@@
static void wps_er_http_resp_ok(struct http_request *req)
static void wps_er_sta_timeout(void *eloop_data, void *user_ctx)
{
static void wps_er_sta_timeout(void *eloop_data, void *user_ctx)
{
- struct wps_er_sta *
prev, *tmp, *
sta = eloop_data;
+ struct wps_er_sta *sta = eloop_data;
wpa_printf(MSG_DEBUG, "WPS ER: STA entry timed out");
wpa_printf(MSG_DEBUG, "WPS ER: STA entry timed out");
- tmp = sta->ap->sta;
- prev = NULL;
- while (tmp) {
- if (tmp == sta)
- break;
- prev = tmp;
- tmp = tmp->next;
- }
- if (tmp) {
- if (prev)
- prev->next = sta->next;
- else
- sta->ap->sta = sta->next;
- }
+ wps_er_sta_unlink(sta);
wps_er_sta_free(sta);
}
wps_er_sta_free(sta);
}