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

* Re: [PATCH] tether: Fix connman_technology_get_wifi_tethering
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-10-24  7:45 UTC (permalink / raw)
  To: connman, Daniel Wagner

Hi

I keep the compatibility. Another option is to give back them all anyway

Michael

On Sat, Oct 23, 2021 at 11:50 PM Michael Trimarchi
<michael@amarulasolutions.com> wrote:
>
> 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
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH] tether: Fix connman_technology_get_wifi_tethering
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Wagner @ 2021-10-26  7:05 UTC (permalink / raw)
  To: connman, Michael Trimarchi; +Cc: Daniel Wagner

On Sat, 23 Oct 2021 21:49:53 +0000, Michael Trimarchi wrote:
> The function is called from tethering, so the tethering is not
> yet enabled. We need to workaround in order to get the right
> value
> 
> 

Applied, thanks!

[1/1] tether: Fix connman_technology_get_wifi_tethering
      commit: bc26ab84e4a77950104c6c60609b549b9ce2830f

Best regards,
-- 
Daniel Wagner <wagi@monom.org>

^ 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).