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

Dmitry Shmidt dimitrysh
Fri Jun 26 14:31:17 PDT 2015

On Fri, Jun 26, 2015 at 12:56 PM, Jouni Malinen <j at w1.fi> wrote:
> 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
> wpa_msg_ctrl().

You are right, let's leave wpa_dbg message

> 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..

The issue our wifi manager developers are trying to resolve is next:
We select network to connect but let's say it is not in real scan results.
wpa_supplicant will "do nothing". It will print debug log, but wifi manager
will not know that it is not planning to do anything else.

If there is other way to catch this situation, rather then explicitly
send the event above, it will be great.

> --
> Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list