nl80211: Fix vendor command handling

In wiphy_info_handler(), vendor specific commands were
interpreted as QCA specific without checking for the OUI,
which caused incorrect setting of driver flags with
commands from other vendors. As a result, that could
prevent proper operation (e.g., inability to process CSA).

This patch ensures that QCA vendor specific commands are
checked against QCA OUI before related flags are set.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
This commit is contained in:
Zefir Kurtisi 2015-03-18 18:26:59 +01:00 committed by Jouni Malinen
parent 55e8f0eafc
commit 5f9c92f8f7

View file

@ -575,22 +575,25 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
continue; continue;
} }
vinfo = nla_data(nl); vinfo = nla_data(nl);
switch (vinfo->subcmd) { if (vinfo->vendor_id == OUI_QCA) {
case QCA_NL80211_VENDOR_SUBCMD_TEST: switch (vinfo->subcmd) {
drv->vendor_cmd_test_avail = 1; case QCA_NL80211_VENDOR_SUBCMD_TEST:
break; drv->vendor_cmd_test_avail = 1;
case QCA_NL80211_VENDOR_SUBCMD_ROAMING: break;
drv->roaming_vendor_cmd_avail = 1; case QCA_NL80211_VENDOR_SUBCMD_ROAMING:
break; drv->roaming_vendor_cmd_avail = 1;
case QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY: break;
drv->dfs_vendor_cmd_avail = 1; case QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY:
break; drv->dfs_vendor_cmd_avail = 1;
case QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES: break;
drv->get_features_vendor_cmd_avail = 1; case QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES:
break; drv->get_features_vendor_cmd_avail = 1;
case QCA_NL80211_VENDOR_SUBCMD_DO_ACS: break;
drv->capa.flags |= WPA_DRIVER_FLAGS_ACS_OFFLOAD; case QCA_NL80211_VENDOR_SUBCMD_DO_ACS:
break; drv->capa.flags |=
WPA_DRIVER_FLAGS_ACS_OFFLOAD;
break;
}
} }
wpa_printf(MSG_DEBUG, "nl80211: Supported vendor command: vendor_id=0x%x subcmd=%u", wpa_printf(MSG_DEBUG, "nl80211: Supported vendor command: vendor_id=0x%x subcmd=%u",