diff options
| author | Jouni Malinen <j@w1.fi> | 2015-07-26 13:39:55 +0300 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:19:59 -0600 |
| commit | bae2b9da0dcd36749af1c51c9abedb4149abcd79 (patch) | |
| tree | 7a950403be3332517a14c6967a6ea4079aee99a6 /src/fst | |
| parent | ab550917e3dc52c31ef5bb730be31e5f680385a2 (diff) | |
| download | android_external_wpa_supplicant_8-bae2b9da0dcd36749af1c51c9abedb4149abcd79.tar.gz android_external_wpa_supplicant_8-bae2b9da0dcd36749af1c51c9abedb4149abcd79.tar.bz2 android_external_wpa_supplicant_8-bae2b9da0dcd36749af1c51c9abedb4149abcd79.zip | |
FST: Use more robust interface-find for event messages
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.
Change-Id: I6e5d4de239b17ec66e9fb58ed76fad3a36f31b0e
Signed-off-by: Jouni Malinen <j@w1.fi>
Git-commit: 481fa8fb22b6e34887767c79e34ea2fc019e40bc
Git-repo: git://w1.fi/srv/git/hostap.git
CRs-Fixed: 891455
Diffstat (limited to 'src/fst')
| -rw-r--r-- | src/fst/fst_ctrl_iface.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/fst/fst_ctrl_iface.c b/src/fst/fst_ctrl_iface.c index cb18c5e6..06bba5a5 100644 --- a/src/fst/fst_ctrl_iface.c +++ b/src/fst/fst_ctrl_iface.c @@ -78,12 +78,11 @@ static Boolean format_session_state_extra(const union fst_event_extra *extra, } -static void fst_ctrl_iface_notify(u32 session_id, +static void fst_ctrl_iface_notify(struct fst_iface *f, u32 session_id, enum fst_event_type event_type, const union fst_event_extra *extra) { struct fst_group *g; - struct fst_iface *f; char extra_str[128] = ""; const struct fst_event_extra_session_state *ss; const struct fst_event_extra_iface_state *is; @@ -94,13 +93,15 @@ static void fst_ctrl_iface_notify(u32 session_id, * on global Control Interface, so we just pick the 1st one. */ - g = fst_first_group(); - if (!g) - return; - - f = fst_group_first_iface(g); - if (!f) - return; + if (!f) { + foreach_fst_group(g) { + f = fst_group_first_iface(g); + if (f) + break; + } + if (!f) + return; + } WPA_ASSERT(f->iface_obj.ctx); @@ -702,7 +703,7 @@ static void fst_ctrl_iface_on_iface_state_changed(struct fst_iface *i, os_strlcpy(extra.iface_state.group_id, fst_iface_get_group_id(i), sizeof(extra.iface_state.group_id)); - fst_ctrl_iface_notify(FST_INVALID_SESSION_ID, + fst_ctrl_iface_notify(i, FST_INVALID_SESSION_ID, EVENT_FST_IFACE_STATE_CHANGED, &extra); } @@ -726,7 +727,7 @@ static void fst_ctrl_iface_on_event(enum fst_event_type event_type, { u32 session_id = s ? fst_session_get_id(s) : FST_INVALID_SESSION_ID; - fst_ctrl_iface_notify(session_id, event_type, extra); + fst_ctrl_iface_notify(i, session_id, event_type, extra); } |
