From: Michael Trimarchi <michael@amarulasolutions.com>
To: connman@lists.linux.dev
Subject: [PATCH] tether: Fix connman_technology_get_wifi_tethering
Date: Sat, 23 Oct 2021 21:49:53 +0000 [thread overview]
Message-ID: <20211023214953.5606-1-michael@amarulasolutions.com> (raw)
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
next reply other threads:[~2021-10-23 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-23 21:49 Michael Trimarchi [this message]
2021-10-24 7:45 ` [PATCH] tether: Fix connman_technology_get_wifi_tethering Michael Nazzareno Trimarchi
2021-10-26 7:05 ` Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211023214953.5606-1-michael@amarulasolutions.com \
--to=michael@amarulasolutions.com \
--cc=connman@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).