aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-26 15:44:39 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-26 15:45:13 (GMT)
commitfa95b7c0739481e578b903260892b9bc212bddb2 (patch)
treee21ad0bcd0737b08dc9c93a1ad711bbc0853db80 /src/fst
parent481fa8fb22b6e34887767c79e34ea2fc019e40bc (diff)
downloadhostap-fa95b7c0739481e578b903260892b9bc212bddb2.zip
hostap-fa95b7c0739481e578b903260892b9bc212bddb2.tar.gz
hostap-fa95b7c0739481e578b903260892b9bc212bddb2.tar.bz2
FST: Use more robust interface-find for TEST_REQUEST
It is possible for there to be multiple FST groups, so the hardcoded mechanism of selecting the first one when sending out an event message may not be sufficient. Get the interface from the caller, if available, and if not, go through all groups in search of an interface to send the event on. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst_session.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/fst/fst_session.c b/src/fst/fst_session.c
index 7a4d6db..55fa694 100644
--- a/src/fst/fst_session.c
+++ b/src/fst/fst_session.c
@@ -1328,13 +1328,11 @@ static int get_group_fill_session(struct fst_group **g, struct fst_session *s)
struct fst_get_peer_ctx *ctx;
os_memset(s, 0, sizeof(*s));
- *g = dl_list_first(&fst_global_groups_list,
- struct fst_group, global_groups_lentry);
- if (!*g)
- return -EINVAL;
-
- s->data.new_iface = dl_list_first(&(*g)->ifaces, struct fst_iface,
- group_lentry);
+ foreach_fst_group(*g) {
+ s->data.new_iface = fst_group_first_iface(*g);
+ if (s->data.new_iface)
+ break;
+ }
if (!s->data.new_iface)
return -EINVAL;