[PATCH v2 07/11] nl80211: add helper method for control port usage

Markus Theil <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
This patch adds another helper method, which returns the
connect_or_ctrl socket when needed.

Signed-off-by: Markus Theil <[email protected]>
---
 src/drivers/driver_nl80211.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 14a7e465e..9549d9b18 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -478,6 +478,18 @@ out:
 }
 
 
+struct nl_sock* get_connect_or_ctrl_handle(struct i802_bss *bss)
+{
+	struct nl_sock *nl_connect_or_ctrl = NULL;
+
+	if (bss->drv->capa.flags & WPA_DRIVER_FLAGS_CONTROL_PORT ||
+	    bss->use_nl_connect)
+		nl_connect_or_ctrl = bss->nl_connect_or_ctrl;
+
+	return nl_connect_or_ctrl;
+}
+
+
 struct family_data {
 	const char *group;
 	int id;
-- 
2.26.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.