[PATCH 35/92] NAN: Send NIK after successful pairing

Jouni Malinen j at w1.fi
Sat Apr 25 11:22:24 PDT 2026


On Wed, Apr 22, 2026 at 03:23:26PM +0300, Andrei Otcheretianski wrote:
> When NPK caching is enabled, send a followup message with the NIK
> from the pairing initiator to the pairing responder after pairing
> is completed.

> @@ -554,6 +697,19 @@ int nan_pairing_pasn_auth_tx_status(struct nan_data *nan, const u8 *data,
>  		nan_pairing_done(nan, peer);
> +
> +		/*
> +		 * Allow the peer to install the keys before transmitting the
> +		 * follow up
> +		 */
> +		os_sleep(0, 30000);
> +
> +		if (nan_send_nik(nan, peer) < 0) {

Is that sleep really needed here? os_sleep() should not really used
anywhere in upper layers processing in wpa_supplicant since it blocks
all other operations that could be in progress in parallel. In other
words, if a wait is truly needed (which sounds like bad protocol
design), it should be done using a registered eloop timeout.

I do see the nan_sae_pairing test case failing if I were to remove this
os_sleep(), but maybe that is an artifact of using UML with time-travel.
Where does that 30 ms time come from? In any case, this needs to be
improved. I'm considering of applying this now to get the pending NAN
patch queue shorter, so please think of an additional patch on top of
this patchset to get rid of the blocking sleep here.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list