connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
	<Emmanuel.VAUTRIN@cpexterne.org>
Cc: "connman@lists.linux.dev" <connman@lists.linux.dev>
Subject: Re: [PATCH 3/3] iwd: Ensure hidden services connectable after removed
Date: Mon, 4 Oct 2021 09:06:11 +0200	[thread overview]
Message-ID: <20211004070611.usnxi6bbmkfanxs6@beryllium.lan> (raw)
In-Reply-To: <MRZP264MB154491FD5A024CBCF0147E5B93AB9@MRZP264MB1544.FRAP264.PROD.OUTLOOK.COM>

On Fri, Oct 01, 2021 at 03:29:16PM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote:
> Hidden services shall always be connectable, even after been removed.
> When a hidden service is removed, the associated iwd network stays as
> known and thus shall be connected as a visible network.
> ---
>  plugins/iwd.c | 71 +++++++++++++++++++++++++++++++++++++++------------
>  1 file changed, 54 insertions(+), 17 deletions(-)
> 
> diff --git a/plugins/iwd.c b/plugins/iwd.c
> index 961d53196207..9bd27e90c346 100644
> --- a/plugins/iwd.c
> +++ b/plugins/iwd.c
> @@ -140,6 +140,7 @@ struct iwd_station {
>  	bool scanning;
>  
>  	GHashTable *hidden_aps;
> +	GHashTable *hidden_networks;
>  	struct hidden_params *hidden;
>  	bool postpone_hidden;
>  };
> @@ -646,6 +647,37 @@ static void hidden_params_free(gpointer data)
>  	g_free(hidden);
>  }
>  
> +static int connect_hidden(struct iwd_station *iwds)
> +{
> +	struct iwd_network *iwdn;
> +	char *ssid_security;
> +	int err = 0;
> +
> +	ssid_security = g_strdup_printf("%s_%s",
> +				iwds->hidden->ssid, iwds->hidden->security);
> +	iwdn = g_hash_table_lookup(iwds->hidden_networks, ssid_security);
> +	if (iwdn) {
> +		err = connman_network_connect_hidden(iwdn->network,
> +				iwds->hidden->identity,
> +				iwds->hidden->passphrase,
> +				iwds->hidden->user_data);
> +		iwds->hidden->user_data = NULL;
> +	if (err == -EINPROGRESS)
> +		err = 0;

You could do a 'return 0' here.


  reply	other threads:[~2021-10-04  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 15:29 VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-10-04  7:06 ` Daniel Wagner [this message]
2021-10-04  9:22   ` VAUTRIN Emmanuel (Canal Plus Prestataire)

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=20211004070611.usnxi6bbmkfanxs6@beryllium.lan \
    --to=wagi@monom.org \
    --cc=Emmanuel.VAUTRIN@cpexterne.org \
    --cc=connman@lists.linux.dev \
    --subject='Re: [PATCH 3/3] iwd: Ensure hidden services connectable after removed' \
    /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

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