Re: Bssid to supplicant config



On Fri, 2008-05-16 at 15:46 +0800, charlyliu wrote:
> Hi all,
> 
> I'm trying to pass the AP bssid to a connection setting (at wireless_new_auto_connection) so when I want to connect, I also check the bssid. I do this because I notice that it doesn't connect if there is 2 aps with the same SSID and one is with WEP encryption (the one I want to connect to). 

This sounds somewhat like a driver problem.  Given an SSID and security
parameters (via ENCODE, or ENCODEEXT + GENIE + AUTH), the driver takes
the intersection of the parameters given to it by userspace, and it's
own internal scan list, and uses one of the resulting BSSIDs to
associate with.

So given an SSID and WEP encryption, the driver should not even be
considering association with the non-WEP AP.  However, if both APs have
the same SSID, and the same security parameters, then the driver would
be free to choose either AP to associate with since there's no
discernable difference between their capabilities.

> I tried many ways, saving a ether_addr inside the bssid->data, saving the string that I get with the function nm_access_point_get_hw_address and changing the settings verify, nm_ap_check_compatible and nm_supplicant_config_add_setting_wireless. But either ways work.

bssid is a GByteArray, so you'll need to initialize it with something
like:

void set_bssid(struct ether_addr *addr, NMSetting80211Wireless *s_wireless)
{
	if (s_wireless->bssid)
		g_byte_array_free (s_wireless->bssid, TRUE);

	s_wireless->bssid = g_byte_array_sized_new (ETH_ALEN);
	g_byte_array_append (s_wireless->bssid, (const guint8 *) addr->ether_addr_octet, ETH_ALEN);
}

Then of course that setting information gets pushed down to
NetworkManager, which pushes it further down to the supplicant.  In your
syslog messages during connection, do you see anything like:

NetworkManager: <info>  Config: added 'bssid' value 'xx:xx:xx:xx:xx:xx'

after setting the BSSID correctly in your settings service?  If not,
then there's a bug in NetworkManager.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]