Re: [PATCH 9/9] hs20-client: Add 1 second sleep after IP is detected to allow external config to complete.

Jouni Malinen <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
On Fri, Feb 07, 2020 at 01:10:17AM -0800, [email protected] wrote:
> For instance, setting up VRFs and such might take a small bit of extra time.

What is VRF and why would a user space tool on a station device need to
know about that?

> diff --git a/hs20/client/oma_dm_client.c b/hs20/client/oma_dm_client.c
> @@ -1211,6 +1211,8 @@ int cmd_oma_dm_sim_prov(struct hs20_osu_client *ctx, const char *url)
>  	if (wait_ip_addr(ctx->ifname, 15) < 0) {
>  		wpa_printf(MSG_INFO, "Could not get IP address for WLAN - try connection anyway");
>  	}
> +	/* Give a bit more time in case external tools are still configuring things, like VRF. */
> +	os_sleep(1, 0);
>  	write_summary(ctx, "OMA-DM SIM provisioning");

Wouldn't it make more sense to do whatever is needed within
wait_ip_addr() instead of copy pasting this into every location where
wait_ip_addr() is called? That said, I'm not convinced waiting one
second is the thing that should happen here.

What exactly are the cases where you have needed to wait longer after
the IP address has been assigned? Maybe wait_ip_addr() (or
wpa_supplicant before indicating STATUS command ip_address field) should
wait for those exact things rather than adding a hardcoded wait for one
second.

-- 
Jouni Malinen                                            PGP id EFC895FA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.