mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-30 00:34:03 -05:00
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>
This commit is contained in:
parent
481fa8fb22
commit
fa95b7c073
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user