aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>2015-07-19 12:13:23 +0300
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:19:53 -0600
commit73d87076064f08010159aa1714f8eec75ca18aac (patch)
tree9e71ea93d014bb113e869461c1b8632beb32fbaf /hostapd
parent63cbf41a999abee0e36a50ad65781a1b07a2baa3 (diff)
downloadandroid_external_wpa_supplicant_8-73d87076064f08010159aa1714f8eec75ca18aac.tar.gz
android_external_wpa_supplicant_8-73d87076064f08010159aa1714f8eec75ca18aac.tar.bz2
android_external_wpa_supplicant_8-73d87076064f08010159aa1714f8eec75ca18aac.zip
hostapd: Introduce hostapd_interfaces_get_hapd()
This function will be used in DUP_NETWORK command implementation. Change-Id: I6df3e81dceb462eb7abab43c62e357f49dc16635 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: b328145296d6595cfd9b326cd6dfb4fcbdda89e2 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 891455
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/ctrl_iface.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 0b6b1f73..2dd2e0ae 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2490,27 +2490,39 @@ hostapd_global_ctrl_iface_fst_detach(struct hapd_interfaces *interfaces,
#endif /* CONFIG_FST */
-static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces,
- const char *ifname,
- char *buf, char *reply,
- int reply_size,
- struct sockaddr_un *from,
- socklen_t fromlen)
+
+static struct hostapd_data *
+hostapd_interfaces_get_hapd(struct hapd_interfaces *interfaces,
+ const char *ifname)
{
size_t i, j;
- struct hostapd_data *hapd = NULL;
- for (i = 0; hapd == NULL && i < interfaces->count; i++) {
+ for (i = 0; i < interfaces->count; i++) {
struct hostapd_iface *iface = interfaces->iface[i];
for (j = 0; j < iface->num_bss; j++) {
+ struct hostapd_data *hapd;
+
hapd = iface->bss[j];
if (os_strcmp(ifname, hapd->conf->iface) == 0)
- break;
- hapd = NULL;
+ return hapd;
}
}
+ return NULL;
+}
+
+
+static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces,
+ const char *ifname,
+ char *buf, char *reply,
+ int reply_size,
+ struct sockaddr_un *from,
+ socklen_t fromlen)
+{
+ struct hostapd_data *hapd;
+
+ hapd = hostapd_interfaces_get_hapd(interfaces, ifname);
if (hapd == NULL) {
int res;