From oberman@slan.es.net  Wed May 31 15:04:04 2006
Return-Path: <oberman@slan.es.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C5AD716B36B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 May 2006 15:04:04 +0000 (UTC)
	(envelope-from oberman@slan.es.net)
Received: from slan.es.net (slan-lvk.es.net [198.128.4.60])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CBF4043D5A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 May 2006 15:04:02 +0000 (GMT)
	(envelope-from oberman@slan.es.net)
Received: by slan.es.net (Postfix, from userid 9381)
	id 633D55C50; Wed, 31 May 2006 08:04:02 -0700 (PDT)
Message-Id: <20060531150402.633D55C50@slan.es.net>
Date: Wed, 31 May 2006 08:04:02 -0700 (PDT)
From: Kevin Oberman <oberman@slan.es.net>
Reply-To: Kevin Oberman <oberman@slan.es.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: wpa_supplicant operation does not match documentation
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         98220
>Category:       bin
>Synopsis:       wpa_supplicant(8) operation does not match documentation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 31 15:10:18 GMT 2006
>Closed-Date:    
>Last-Modified:  Tue Jul 13 22:19:54 UTC 2010
>Originator:     Kevin Oberman
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
ESnet-The Energy Science Network
>Environment:
System: FreeBSD slan.es.net 7.0-CURRENT FreeBSD 7.0-CURRENT #15: Tue May 23 14:19:22 PDT 2006 root@slan.es.net:/usr/obj/usr/src/sys/IBM-T43 i386


	
>Description:
	The wpa_supplicant man page claims that if several SSIDs are
contained in a single priority group, they will be preferred in the
order they appear. This is not the case. the selection is two 'for'
loops:
list of scanned BSSes
	check for matches with configured networks
Thus, the first entry in the list of scanned networks (which is,
essentially random) will match with any of the the networks in the
priority group with no attempt to match any other BSSes to the earlier
entries.

>How-To-Repeat:
	Build a wpa_supplicant.conf file with several networks in the
preferred order. Start the supplicant in a location where available
BSSes match both the first and last network entry. Start the
supplicant in debug. It will choose the first BSS in the list of
available BSSes that matches any entry. Restart the supplicant for a
repeat with a re-ordered BSSes and the first match is chosen again.

>Fix:
Either:
	The code in wpa_supplicant_select_bss in events.c needs to be
re-ordered so that the testing of each network ssid against the first
BSS seen is done before moving on to the next BSS.
or:
	Modify the documentation to state that a match to any SSID listed
in a priority group will be chosen at random with no regard to the order
of the entries in the configuration.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: gavin 
State-Changed-When: Tue Jul 13 22:15:15 UTC 2010 
State-Changed-Why:  
wpa_supplicant is contributed code.  As far as I can tell, the bug still exists 
in the newest 0.7.x version (which has not yet been imported into FreeBSD) and 
as a result I think the best idea is to take this up with the wpa_supplicant 
developers themselves, at http://hostap.epitest.fi/wpa_supplicant/ 
I've had a quick search of their bug database and can't see the problem already 
reported. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98220 
>Unformatted:
