diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1c2f943ea..0433ca64b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2738,9 +2738,6 @@ static void wiphy_info_supp_cmds(struct wiphy_info_data *info, static void wiphy_info_max_roc(struct wpa_driver_capa *capa, struct nlattr *tb) { - /* default to 5000 since early versions of mac80211 don't set it */ - capa->max_remain_on_chan = 5000; - if (tb) capa->max_remain_on_chan = nla_get_u32(tb); } @@ -2932,6 +2929,11 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv, "concurrent (driver advertised support)"); drv->capa.flags |= WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT; } + + /* default to 5000 since early versions of mac80211 don't set it */ + if (!drv->capa.max_remain_on_chan) + drv->capa.max_remain_on_chan = 5000; + return 0; nla_put_failure: nlmsg_free(msg);