public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: Denis Kenzior <denkenz@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH v2 02/15] dpp: remove connect/scanning and resume periodic scans after DPP
Date: Mon, 30 Oct 2023 04:35:34 -0700	[thread overview]
Message-ID: <70cf034a-485c-4cdf-a042-39eb45fd190f@gmail.com> (raw)
In-Reply-To: <428501e8-9ad3-4b83-adb7-e60530e98270@gmail.com>

Hi Denis,

On 10/29/23 3:04 PM, Denis Kenzior wrote:
> Hi James,
> 
> On 10/26/23 15:26, James Prestwood wrote:
>> When DPP is started periodic scans are stopped but never started
>> again. This means if DPP fails IWD will never resume autoconnecting
>> without some intervention.
>>
> 
> Okay, but why are you not removing scan_periodic_stop() calls then?  If 
> the intent is to use station_set_autoconnect, then do that.  And this 
> probably requires a separate patch.

One thing I overlooked here was the fact that offchannel requests are at 
a higher priority than scanning, and since we "block" the work queue in 
DPP they will resume afterwards.

So these patches aren't very useful and instead I will remove 
periodic_scan_stop calls (to retain the autoconnect state) and change 
station_connect_network to be callable without a dbus message (to fix 
the state problem).

> 
>> This also removes the internal scanning/connecting logic from DPP
>> which was done for two reasons. First its unknown how long the
>> DPP protocol took and its safest to explicitly scan to find the
> 
> Isn't this being done by invoking scan_active?
> 
>> target network/bss, and second the connect logic was flawed because
>> station will not transition into a CONNECTING state since
>> __station_connect_network shortcuts the state change. If DPP failed
> 
> Okay, so use station_connect_network?
> 
>> station would never resume autoconnecting, and if the post-DPP
>> connection failed the state was set incorrectly so station would
>> also not resume autoconnecting.
>>
>> The downside of this is it takes slightly longer to connect after
>> DPP since IWD must scan, but the DPP logic is simplified and keeps
>> all connection logic in station.c where it belongs.
> 
> Well, the downside of this approach is that you're relying completely on 
> autoconnect logic to pick the right network instead of having DPP 
> connect to the network that was just configured.  So if autoconnect 
> picks a different network you get results the user doesn't expect.

Yeah, this too.

> 
>> ---
>>   src/dpp.c | 76 ++++++++++++++++++++-----------------------------------
>>   1 file changed, 27 insertions(+), 49 deletions(-)
>>
> 
> <snip>
> 
>> @@ -315,7 +313,17 @@ static void dpp_reset(struct dpp_sm *dpp)
>>           dpp->retry_timeout = NULL;
>>       }
>> +    /*
>> +     * Set station back to its original autoconnecting state if an
>> +     * enrollee and DPP failed
>> +     */
>> +    if (station && dpp->role == DPP_CAPABILITY_ENROLLEE &&
>> +            dpp->station_autoconnecting &&
>> +            dpp->state != DPP_STATE_SUCCESS)
>> +        station_set_autoconnect(station, true);
> 
> So what if autoconnect was false originally?
> 
>> @@ -830,16 +805,9 @@ static void 
>> dpp_handle_config_response_frame(const struct mmpdu_header *frame,
>>       offchannel_cancel(dpp->wdev_id, dpp->offchannel_id);
>> -    if (network && bss)
>> -        __station_connect_network(station, network, bss);
>> -    else if (station) {
>> -        dpp->connect_scan_id = scan_active(dpp->wdev_id, NULL, 0,
>> -                        dpp_scan_triggered,
>> -                        dpp_scan_results, dpp,
>> -                        dpp_scan_destroy);
> 
> Likely this needs to be a filtered scan (with SSID) as opposed to wildcard >
>> -        if (dpp->connect_scan_id)
>> -            return;
>> -    }
>> +    dpp->state = DPP_STATE_SUCCESS;
>> +
>> +    station_set_autoconnect(station, true);
>>       dpp_reset(dpp);
>>   }
> 
> Regards,
> -Denis
> 

  reply	other threads:[~2023-10-30 11:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 20:26 [PATCH v2 00/15] DPP PKEX Changes James Prestwood
2023-10-26 20:26 ` [PATCH v2 01/15] station: add station_get_autoconnect James Prestwood
2023-10-26 20:26 ` [PATCH v2 02/15] dpp: remove connect/scanning and resume periodic scans after DPP James Prestwood
2023-10-29 22:04   ` Denis Kenzior
2023-10-30 11:35     ` James Prestwood [this message]
2023-10-26 20:26 ` [PATCH v2 03/15] dpp: check configurator role in config request frame James Prestwood
2023-10-29 22:07   ` Denis Kenzior
2023-10-26 20:26 ` [PATCH v2 04/15] dpp: make the protocol timeout more flexible James Prestwood
2023-10-26 20:26 ` [PATCH v2 05/15] dpp: fix config request header check James Prestwood
2023-10-26 21:53   ` James Prestwood
2023-10-26 20:26 ` [PATCH v2 06/15] dpp-util: add crypto for PKEX James Prestwood
2023-10-29 22:22   ` Denis Kenzior
2023-10-26 20:26 ` [PATCH v2 07/15] dpp: support mutual authentication James Prestwood
2023-10-26 20:26 ` [PATCH v2 08/15] unit: make test-dpp key derivation test more extendable James Prestwood
2023-10-26 20:26 ` [PATCH v2 09/15] unit: add DPP test for mutual authentication James Prestwood
2023-10-26 20:26 ` [PATCH v2 10/15] unit: add PKEX DPP tests James Prestwood
2023-10-26 20:26 ` [PATCH v2 11/15] dpp: allow enrollee to be authentication initiator James Prestwood
2023-10-26 20:26 ` [PATCH v2 12/15] doc: PKEX support for DPP James Prestwood
2023-10-29 22:27   ` Denis Kenzior
2023-10-30 11:56     ` James Prestwood
2023-10-30 14:40       ` Denis Kenzior
2023-10-26 20:26 ` [PATCH v2 13/15] dbus: add SharedCodeDeviceProvisioning interface definition James Prestwood
2023-10-29 22:29   ` Denis Kenzior
2023-10-26 20:26 ` [PATCH v2 14/15] dpp: initial version of PKEX enrollee support James Prestwood
2023-10-26 20:26 ` [PATCH v2 15/15] dpp: initial version of PKEX configurator support 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=70cf034a-485c-4cdf-a042-39eb45fd190f@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=denkenz@gmail.com \
    --cc=iwd@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