2004-09-09 Dan Williams <dcbw@redhat.com>

* panel-applet/NMWirelessAppletDbus.c
		- Pull fresh devices and networks from NM when wireless networks
			change.  Provides faster feedback of a forced wireless network

	* src/NetworkManagerDbus.c
		- Return error when "getMaxQuality" is called on a wired device
		- Make best_ap freezing actually work again, and signal cancellation
			of activation if there's already a device activation when the user
			freezes the best_ap

	* src/NetworkManagerDevice.c
		- Don't clear out the best_ap for wireless devices when the link goes
			down, that's done elsewhere
		- Kill any dhcp daemons when cancelling device activation since they
			may be stuck waiting for a DHCP address, and since we're cancelling
			activation we don't care about that anymore

	* src/NetworkManagerPolicy.c
		- Make sure to unref the device we ref earlier (we refed it to make sure
			it stuck around during device activation and such)
		- If we were going to change the best device, but its activating currently
			(and therefore the change didn't occur due to the check earlier)
			we mark the state changed to we come back to it later when device
			activation has canceled and its no longer activating

	* src/backends/NetworkManagerRedHat.c
		- SIGKILL dhcp daemons rather than SIGTERM-ing them


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@143 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2004-09-09 21:34:40 +00:00
parent 54d7c3e436
commit 9e32ee7856
6 changed files with 58 additions and 6 deletions

View File

@@ -1,3 +1,33 @@
2004-09-09 Dan Williams <dcbw@redhat.com>
* panel-applet/NMWirelessAppletDbus.c
- Pull fresh devices and networks from NM when wireless networks
change. Provides faster feedback of a forced wireless network
* src/NetworkManagerDbus.c
- Return error when "getMaxQuality" is called on a wired device
- Make best_ap freezing actually work again, and signal cancellation
of activation if there's already a device activation when the user
freezes the best_ap
* src/NetworkManagerDevice.c
- Don't clear out the best_ap for wireless devices when the link goes
down, that's done elsewhere
- Kill any dhcp daemons when cancelling device activation since they
may be stuck waiting for a DHCP address, and since we're cancelling
activation we don't care about that anymore
* src/NetworkManagerPolicy.c
- Make sure to unref the device we ref earlier (we refed it to make sure
it stuck around during device activation and such)
- If we were going to change the best device, but its activating currently
(and therefore the change didn't occur due to the check earlier)
we mark the state changed to we come back to it later when device
activation has canceled and its no longer activating
* src/backends/NetworkManagerRedHat.c
- SIGKILL dhcp daemons rather than SIGTERM-ing them
2004-09-09 Bryan Clark <clarkbw@cvs.gnome.org> 2004-09-09 Bryan Clark <clarkbw@cvs.gnome.org>
* info-daemon/passphrase.glade: * info-daemon/passphrase.glade:

View File

@@ -1133,6 +1133,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating")) || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating"))
{ {
nmwa_dbus_update_network_state (applet); nmwa_dbus_update_network_state (applet);
nmwa_dbus_update_devices (applet);
nmwa_dbus_update_active_device (applet); nmwa_dbus_update_active_device (applet);
} }
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged")) else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged"))

View File

@@ -1030,7 +1030,18 @@ static DBusMessage *nm_dbus_devices_handle_request (DBusConnection *connection,
else if (strcmp ("getIP4Address", request) == 0) else if (strcmp ("getIP4Address", request) == 0)
dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, nm_device_get_ip4_address (dev), DBUS_TYPE_INVALID); dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, nm_device_get_ip4_address (dev), DBUS_TYPE_INVALID);
else if (strcmp ("getMaxQuality", request) == 0) else if (strcmp ("getMaxQuality", request) == 0)
{
/* Only wireless devices have an active network */
if (!nm_device_is_wireless (dev))
{
dbus_message_unref (reply_message);
reply_message = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE, "DeviceNotWireless",
"Wired devices cannot have wireless networks.");
return (reply_message);
}
dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, nm_device_get_max_quality (dev), DBUS_TYPE_INVALID); dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, nm_device_get_max_quality (dev), DBUS_TYPE_INVALID);
}
else if (strcmp ("getActiveNetwork", request) == 0) else if (strcmp ("getActiveNetwork", request) == 0)
{ {
NMAccessPoint *ap; NMAccessPoint *ap;
@@ -1186,8 +1197,10 @@ static DBusHandlerResult nm_dbus_nm_message_handler (DBusConnection *connection,
if ((ap = nm_ap_list_get_ap_by_essid (nm_device_ap_list_get (data->active_device), network))) if ((ap = nm_ap_list_get_ap_by_essid (nm_device_ap_list_get (data->active_device), network)))
{ {
syslog (LOG_DEBUG, "Forcing AP '%s'", nm_ap_get_essid (ap)); syslog (LOG_DEBUG, "Forcing AP '%s'", nm_ap_get_essid (ap));
nm_device_freeze_best_ap (data->active_device);
nm_device_set_best_ap (data->active_device, ap); nm_device_set_best_ap (data->active_device, ap);
nm_device_freeze_best_ap (data->active_device);
if (nm_device_activating (data->active_device))
nm_device_activation_signal_cancel (data->active_device);
nm_data_mark_state_changed (data); nm_data_mark_state_changed (data);
} }
dbus_free (network); dbus_free (network);

View File

@@ -443,8 +443,6 @@ void nm_device_set_link_active (NMDevice *dev, const gboolean link_active)
g_return_if_fail (dev != NULL); g_return_if_fail (dev != NULL);
dev->link_active = link_active; dev->link_active = link_active;
if (!link_active && nm_device_is_wireless (dev))
nm_device_set_best_ap (dev, NULL);
} }
@@ -1252,7 +1250,7 @@ static gpointer nm_device_activation_worker (gpointer user_data)
/* If we were told to quit activation, stop the thread and return */ /* If we were told to quit activation, stop the thread and return */
if (nm_device_activation_cancel_if_needed (dev)) if (nm_device_activation_cancel_if_needed (dev))
return; return (NULL);
/* Since we've got a link, the encryption method must be good */ /* Since we've got a link, the encryption method must be good */
nm_ap_set_enc_method_good (nm_device_get_best_ap (dev), TRUE); nm_ap_set_enc_method_good (nm_device_get_best_ap (dev), TRUE);
@@ -1353,8 +1351,9 @@ void nm_device_activation_signal_cancel (NMDevice *dev)
if (dev->activating) if (dev->activating)
{ {
syslog (LOG_DEBUG, "nm_device_activation_signal_cancel(%s): canceled", nm_device_get_iface (dev)); syslog (LOG_DEBUG, "nm_device_activation_signal_cancel(%s): cancelling", nm_device_get_iface (dev));
dev->quit_activation = TRUE; dev->quit_activation = TRUE;
nm_system_kill_all_dhcp_daemons (); /* dhcp daemons will block, so have to kill them to return control */
} }
} }
@@ -1715,6 +1714,7 @@ void nm_device_update_best_ap (NMDevice *dev)
{ {
nm_device_bring_down (dev); nm_device_bring_down (dev);
nm_device_set_essid (dev, ""); nm_device_set_essid (dev, "");
nm_device_set_enc_key (dev, NULL);
nm_device_bring_up (dev); nm_device_bring_up (dev);
} }
} }

View File

@@ -301,6 +301,14 @@ gboolean nm_state_modification_monitor (gpointer user_data)
} }
} }
if (best_dev)
{
if (nm_device_activating (best_dev))
nm_data_mark_state_changed (data);
nm_device_unref (best_dev);
}
nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__); nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__);
} }
else else

View File

@@ -109,7 +109,7 @@ void nm_system_device_stop_dhcp (NMDevice *dev)
n_pid = atoi (s_pid); n_pid = atoi (s_pid);
if (n_pid > 0) if (n_pid > 0)
kill (n_pid, SIGTERM); kill (n_pid, SIGKILL);
} }
g_free (buf); g_free (buf);
} }