Problem with the ROAM wpa_cli command and external scans.

Ben Greear greearb at
Fri Jul 10 14:09:59 EDT 2015

On 07/10/2015 10:52 AM, Jouni Malinen wrote:
> On Thu, Jul 09, 2015 at 06:13:07AM -0700, Ben Greear wrote:
>> On 07/08/2015 03:59 PM, Ben Greear wrote:
>>> 1436395477.423911: sta100: Control interface command 'ROAM 04:F0:21:98:D2:34'
>>> 1436395477.423949: CTRL_IFACE ROAM 04:f0:21:98:d2:34
>>> 1436395477.423958: CTRL_IFACE ROAM: No network configuration known for the target AP
>> After reading the code more closely, this last error message actually just
>> appears to mean that the station is not currently associated, and one cannot roam
>> when not already associated?
> Correct, ROAM is special test functionality to allow within-ESS roaming
> cases to be tested.
>> Maybe we should automatically try to do a 'RECONNECT' in this case?
> Why? This is very special command and I'd claim that anything using it
> should be aware of association status as well and as such, should know
> when to use RECONNECT/REATTACH/REASSOCIATE.. That external program needs
> to take care of getting the target BSS into the cfg80211 BSS cache
> anyway, i.e., this is not really supposed to be used in normal use
> cases.

The is-connected check can race with any calling code, and currently I don't
see any way to programatically determine why the ROAM command failed, so it
is hard to know how to properly deal with the failure.

>> In general, it would be nice if wpa_cli had a way to pass very specific error strings
>> or codes + string back to the calling program..that way calling code could be made to know the
>> exact failure reasons and take appropriate action...  Any suggestions as to how to go
>> about doing this?
> Are you talking about the control interface in general (i.e.,
> wpa_supplicant behavior) or something new that wpa_cli would do?

Currently, for instance, I get this output:

[root at ben-ota-2 lanforge]# wpa_cli -i sta100 ROAM aa:bb:cc:dd:ee:ff

It would be nice if output were more like this:

[root at ben-ota-2 lanforge]# wpa_cli -i sta100 ROAM aa:bb:cc:dd:ee:ff
Error-Code: 7707
sta100:  Cannot roam because we can't find this AP in our scan table
at this time.

If we are worried about backwards compat, could call:  wpa_cli --verbose_error [cmds]
so that only those that request the extra info get it.

That error code could be large set of #defines in separate hostap header file that
various programs could #include and program against.


Ben Greear <greearb at>
Candela Technologies Inc

More information about the HostAP mailing list