diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 6d518bdb7..2d7d11d6e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2269,6 +2269,7 @@ struct wiphy_info_data { unsigned int device_ap_sme:1; unsigned int poll_command_supported:1; unsigned int data_tx_status:1; + unsigned int monitor_supported:1; }; @@ -2340,6 +2341,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) case NL80211_IFTYPE_P2P_CLIENT: p2p_client_supported = 1; break; + case NL80211_IFTYPE_MONITOR: + info->monitor_supported = 1; + break; } } } @@ -2560,6 +2564,20 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv) */ drv->use_monitor = !info.poll_command_supported; + if (drv->device_ap_sme && drv->use_monitor) { + /* + * Non-mac80211 drivers may not support monitor interface. + * Make sure we do not get stuck with incorrect capability here + * by explicitly testing this. + */ + if (!info.monitor_supported) { + wpa_printf(MSG_DEBUG, "nl80211: Disable use_monitor " + "with device_ap_sme since no monitor mode " + "support detected"); + drv->use_monitor = 0; + } + } + /* * If we aren't going to use monitor interfaces, but the * driver doesn't support data TX status, we won't get TX