2005-01-27 Dan Williams <dcbw@redhat.com>
* info-daemon/NetworkManagerInfoDbus.c - (nmi_dbus_add_network_address): if the network doesn't yet exist in GConf, make a minimal entry for it (essid & timestamp) * src/NetworkManagerAPList.c - (nm_ap_list_populate_from_nmi): Don't try to grab network data if NetworkManagerInfo isn't running * src/NetworkManagerDbus.[ch] - (nm_dbus_nmi_is_running): new function * src/NetworkManagerDevice.c - (nm_device_wireless_force_use): Don't set the created AP's MAC address to garbage. * src/NetworkManagerPolicy.c - (nm_policy_activation_finish): On successful activation, make sure the "best" AP has a MAC address, and don't tell NMI to add the current AP's MAC address to GConf if the AP is an Ad-hoc AP. - (nm_policy_allowed_ap_list_update): Update a wireless card's "best" access point after refreshing our allowed list if it doesn't already have a "best" access point. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@400 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -249,10 +249,22 @@ gboolean nm_policy_activation_finish (gpointer user_data)
|
||||
/* Tell NetworkManagerInfo to store the MAC address of the active device's AP */
|
||||
if (nm_device_is_wireless (dev))
|
||||
{
|
||||
struct ether_addr addr;
|
||||
NMAccessPoint *ap = NULL;
|
||||
|
||||
nm_device_get_ap_address (dev, &addr);
|
||||
nm_dbus_add_network_address (data->dbus_connection, NETWORK_TYPE_ALLOWED, nm_device_get_essid (dev), &addr);
|
||||
if ((ap = nm_device_get_best_ap (dev)))
|
||||
{
|
||||
struct ether_addr addr;
|
||||
|
||||
nm_device_get_ap_address (dev, &addr);
|
||||
if (!nm_ethernet_address_is_valid (nm_ap_get_address (ap)))
|
||||
nm_ap_set_address (ap, &addr);
|
||||
|
||||
/* Don't store MAC addresses for non-infrastructure networks */
|
||||
if (nm_ap_get_mode (ap) == NETWORK_MODE_INFRA)
|
||||
nm_dbus_add_network_address (data->dbus_connection, NETWORK_TYPE_ALLOWED, nm_ap_get_essid (ap), &addr);
|
||||
|
||||
nm_ap_unref (ap);
|
||||
}
|
||||
}
|
||||
syslog (LOG_INFO, "Activation (%s) successful, device activated.", nm_device_get_iface (data->active_device));
|
||||
break;
|
||||
@@ -458,7 +470,7 @@ void nm_policy_schedule_device_switch (NMDevice *switch_to_dev, NMData *app_data
|
||||
*/
|
||||
static gboolean nm_policy_allowed_ap_list_update (gpointer user_data)
|
||||
{
|
||||
NMData *data = (NMData *)user_data;
|
||||
NMData *data = (NMData *)user_data;
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
|
||||
@@ -471,6 +483,22 @@ static gboolean nm_policy_allowed_ap_list_update (gpointer user_data)
|
||||
if (data->allowed_ap_list)
|
||||
nm_ap_list_populate_from_nmi (data->allowed_ap_list, data);
|
||||
|
||||
/* If the active device doesn't have a best_ap already, make it update to
|
||||
* get the new data.
|
||||
*/
|
||||
if ( data->active_device
|
||||
&& nm_device_is_activating (data->active_device)
|
||||
&& nm_device_is_wireless (data->active_device))
|
||||
{
|
||||
NMAccessPoint *best_ap;
|
||||
|
||||
best_ap = nm_device_get_best_ap (data->active_device);
|
||||
if (!best_ap)
|
||||
nm_device_update_best_ap (data->active_device);
|
||||
else
|
||||
nm_ap_unref (best_ap);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user