diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 612a2667c..604754523 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4809,7 +4809,8 @@ nl80211_get_scan_results(struct wpa_driver_nl80211_data *drv) goto nla_put_failure; nl80211_cmd(drv, msg, NLM_F_DUMP, NL80211_CMD_GET_SCAN); - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex); + if (nl80211_set_iface_id(msg, &drv->first_bss) < 0) + goto nla_put_failure; arg.drv = drv; arg.res = res;