[PATCH] Send CTRL-EVENT-NETWORK-NOT-FOUND if no suitable network was found

Jouni Malinen j
Fri Jun 26 12:56:32 PDT 2015

On Fri, Jun 19, 2015 at 10:40:02AM -0700, Dmitry Shmidt wrote:
> This patch informs upper wifi manager that
> selected network was not found.

> diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
> @@ -1563,7 +1563,7 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
> -		wpa_dbg(wpa_s, MSG_DEBUG, "No suitable network found");
> +		wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_NOT_FOUND);
>  		ssid = wpa_supplicant_pick_new_network(wpa_s);
>  		if (ssid) {
>  			wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");

Replacing wpa_dbg() with wpa_msg_ctrl() would mean that there is no more
debug log entry here which would be undesired. In theory, this could be
wpa_msg() instead of wpa_msg_ctrl(), but I'm not sure this should really
be in debug log at INFO level, so it may be easiest to just leave the
wpa_dbg() there and add a new control-interface-only message with

That said, this looks a bit confusing control interface message for some
use cases, i.e., this new CTRL-EVENT-NETWORK-NOT-FOUND would show up
when setting up an IBSS or AP mode operation with wpa_supplicant. Those
can use this code path.

What would the wifi manager do with this information? How would that
work if wpa_supplicant were to follow up with IBSS or AP mode setup? I
guess the upper layer component would be able to figure out whether that
can happen based on what kind of network profiles are enabled, but
still, that message text would look quite confusing when it would be
immediately followed by starting a network..

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list