Commit 801d3092 authored by Jussi Laakkonen's avatar Jussi Laakkonen

[wifi] Check AP mode using GSupplicant and GSupplicantInterface. JB#42927

Check if either GSupplicant or GSupplicantInterface of the device has AP
capabilities.
parent b938908e
......@@ -3804,12 +3804,25 @@ static int wifi_plugin_set_tethering(struct wifi_plugin *plugin,
for (l = plugin->devices; l && !ap_dev; l = l->next) {
struct wifi_device *dev = l->data;
/*
* Check if either GSupplicantInterface or GSupplicant
* structure has the AP capability.
*/
GSupplicantInterface* iface = dev->iface;
GSupplicant *supplicant = dev->supplicant;
if (iface && iface->valid && (iface->caps.modes &
GSUPPLICANT_INTERFACE_CAPS_MODES_AP)) {
ap_dev = dev;
}
if (supplicant && supplicant->valid &&
(dev->supplicant->caps &
GSUPPLICANT_CAPS_AP)) {
ap_dev = dev;
}
}
if (!ap_dev) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment