($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: James Prestwood <prestwoj@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH 1/2] dpp: scan to pick up extra frequencies when enrolling
Date: Thu, 9 Nov 2023 20:39:07 -0600	[thread overview]
Message-ID: <68c1a1eb-02ea-44c7-8286-8f60f5a415b9@gmail.com> (raw)
In-Reply-To: <20231109195720.56352-2-prestwoj@gmail.com>

Hi James,

On 11/9/23 13:57, James Prestwood wrote:
> The DPP-PKEX spec provides a very limited list of frequencies used
> to discover configurators, only 3 on 2.4 and 5GHz bands. Since
> configurators (at least in IWD's implementation) are only allowed
> on the current operating frequency its very unlikely an enrollee
> will find a configurator on these frequencies out of the entire
> spectrum.
> 
> The spec does mention that the 3 default frequencies should be used
> "In lieu of specific channel information obtained in a manner outside
> the scope of this specification, ...". This allows the implementation
> some flexibility in using a broader range of frequencies.
> 
> To increase the chances of finding a configurator shared code
> enrollees will first issue a scan to determine what access points are
> around, then iterate these frequencies. This is especially helpful
> when the configurators are IWD-based since we know that they'll be
> on the same channels as the APs in the area.
> ---
>   src/dpp.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 93 insertions(+)
> 

Ok, sounds good to me.

> @@ -3994,10 +4008,64 @@ static uint32_t *dpp_default_freqs(struct dpp_sm *dpp, size_t *out_len)
>   	return freqs_out;
>   }
>   
> +static bool dpp_pkex_scan_notify(int err, struct l_queue *bss_list,
> +					const struct scan_freq_set *freqs,
> +					void *user_data)
> +{
> +	struct dpp_sm *dpp = user_data;
> +	const struct l_queue_entry *e;
> +	_auto_(scan_freq_set_free) struct scan_freq_set *freq_set = NULL;
> +
> +	if (err < 0) {
> +		dpp_reset(dpp);
> +		return false;
> +	}
> +
> +	freq_set = scan_freq_set_new();
> +
> +	if (!bss_list || l_queue_isempty(bss_list)) {
> +		dpp->freqs = dpp_default_freqs(dpp, &dpp->freqs_len);

This can return NULL.

> +
> +		l_debug("No BSS's seen, using default frequency list");
> +		goto start;
> +	}
> +
> +	for (e = l_queue_get_entries(bss_list); e; e = e->next) {
> +		const struct scan_bss *bss = e->data;
> +
> +		scan_freq_set_add(freq_set, bss->frequency);
> +	}
> +
> +	l_debug("Found %u frequencies to search for configurator",
> +			l_queue_length(bss_list));
> +
> +	dpp->freqs = scan_freq_set_to_fixed_array(freq_set, &dpp->freqs_len);
> +
> +start:
> +	dpp->current_freq = dpp->freqs[0];

So you'd crash here.

> +
> +	dpp_reset_protocol_timer(dpp, DPP_PKEX_PROTO_TIMEOUT);
> +
> +	l_debug("PKEX start enrollee (id=%s)", dpp->pkex_id ?: "unset");
> +
> +	dpp_start_offchannel(dpp, dpp->current_freq);
> +
> +	return false;
> +}
> +

Regards,
-Denis


  reply	other threads:[~2023-11-10  2:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 19:57 [PATCH 0/2] Shared code scan discovery (improvement) James Prestwood
2023-11-09 19:57 ` [PATCH 1/2] dpp: scan to pick up extra frequencies when enrolling James Prestwood
2023-11-10  2:39   ` Denis Kenzior [this message]
2023-11-09 19:57 ` [PATCH 2/2] doc: document [DeviceProvisioning].EnrolleeScanDiscovery James Prestwood

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=68c1a1eb-02ea-44c7-8286-8f60f5a415b9@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).