connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] tether: Fix connman_technology_get_wifi_tethering
@ 2021-10-23 21:49 Michael Trimarchi
  2021-10-24  7:45 ` Michael Nazzareno Trimarchi
  2021-10-26  7:05 ` Daniel Wagner
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Trimarchi @ 2021-10-23 21:49 UTC (permalink / raw)
  To: connman

The function is called from tethering, so the tethering is not
yet enabled. We need to workaround in order to get the right
value

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 src/technology.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/technology.c b/src/technology.c
index 97419150..5c469111 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -367,19 +367,23 @@ bool connman_technology_get_wifi_tethering(const struct connman_technology *tech
 					const char **ssid, const char **psk,
 					int *freq)
 {
+	bool force = true;
+
 	if (!ssid || !psk)
 		return false;
 
 	*ssid = *psk = NULL;
 
 	/* Workaround for the neard plugin */
-	if (!technology)
+	if (!technology) {
 		technology = technology_find(CONNMAN_SERVICE_TYPE_WIFI);
+		force = false;
+	}
 
 	if (!technology)
 		return false;
 
-	if (!technology->tethering)
+	if (!force && !technology->tethering)
 		return false;
 
 	*ssid = technology->tethering_ident;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-26  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23 21:49 [PATCH] tether: Fix connman_technology_get_wifi_tethering Michael Trimarchi
2021-10-24  7:45 ` Michael Nazzareno Trimarchi
2021-10-26  7:05 ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).