FST: Make sure get_hw_modes() callback is set for hostapd

It looks like fst_wpa_obj::get_hw_modes would have been left
uninitialized in hostapd. It is not obviously clear why this would not
have caused issues earlier, but in any case, better make this set
properly to allow unexpected behavior should that function pointer ever
be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-05-08 00:27:51 +03:00
parent 4537fe124a
commit 993eb12407
2 changed files with 13 additions and 0 deletions

View file

@ -1784,6 +1784,16 @@ static void fst_hostapd_get_channel_info_cb(void *ctx,
}
static int fst_hostapd_get_hw_modes_cb(void *ctx,
struct hostapd_hw_modes **modes)
{
struct hostapd_data *hapd = ctx;
*modes = hapd->iface->hw_features;
return hapd->iface->num_hw_features;
}
static void fst_hostapd_set_ies_cb(void *ctx, const struct wpabuf *fst_ies)
{
struct hostapd_data *hapd = ctx;
@ -1876,9 +1886,11 @@ static const u8 * fst_hostapd_get_peer_next(void *ctx,
void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd,
struct fst_wpa_obj *iface_obj)
{
os_memset(iface_obj, 0, sizeof(*iface_obj));
iface_obj->ctx = hapd;
iface_obj->get_bssid = fst_hostapd_get_bssid_cb;
iface_obj->get_channel_info = fst_hostapd_get_channel_info_cb;
iface_obj->get_hw_modes = fst_hostapd_get_hw_modes_cb;
iface_obj->set_ies = fst_hostapd_set_ies_cb;
iface_obj->send_action = fst_hostapd_send_action_cb;
iface_obj->get_mb_ie = fst_hostapd_get_mb_ie_cb;

View file

@ -5964,6 +5964,7 @@ static const u8 * wpas_fst_get_peer_next(void *ctx,
void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
struct fst_wpa_obj *iface_obj)
{
os_memset(iface_obj, 0, sizeof(*iface_obj));
iface_obj->ctx = wpa_s;
iface_obj->get_bssid = wpas_fst_get_bssid_cb;
iface_obj->get_channel_info = wpas_fst_get_channel_info_cb;