From: Sunil Dutt Date: Mon, 22 Sep 2014 09:06:01 +0000 (+0530) Subject: Check for driver's DFS offload capability before handling DFS X-Git-Tag: hostap_2_3~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53a9bf8180819c2e67be51c1e44b5d942cdc6f9;p=thirdparty%2Fhostap.git Check for driver's DFS offload capability before handling DFS This fixes couple of code paths where the WPA_DRIVER_FLAGS_DFS_OFFLOAD flag was not checked properly and unexpected DFS operations were initiated (and failed) in case the driver handles all these steps. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index b3b61498d..4cae0d993 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -113,6 +113,10 @@ static u8 * hostapd_eid_pwr_constraint(struct hostapd_data *hapd, u8 *eid) hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A) return eid; + /* Let host drivers add this IE if DFS support is offloaded */ + if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) + return eid; + /* * There is no DFS support and power constraint was not directly * requested by config option. diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 26aca2b05..59567dd66 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1182,12 +1182,15 @@ int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err) iface->conf->channel, iface->freq); #ifdef NEED_AP_MLME - /* Check DFS */ - res = hostapd_handle_dfs(iface); - if (res <= 0) { - if (res < 0) - goto fail; - return res; + /* Handle DFS only if it is not offloaded to the driver */ + if (!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)) { + /* Check DFS */ + res = hostapd_handle_dfs(iface); + if (res <= 0) { + if (res < 0) + goto fail; + return res; + } } #endif /* NEED_AP_MLME */