1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 12:28:08 +01:00

Experimental/Testing:

- Fix dhcp not getting released if the disconnect button wasn't pressed explicitly, but a new connection is trying to be made.
This commit is contained in:
imdano
2008-06-23 08:08:53 +00:00
parent 4e3f3aad30
commit 2d18e61a65
2 changed files with 8 additions and 1 deletions

View File

@@ -314,6 +314,11 @@ class ConnectThread(threading.Thread):
self.abort_reason = reason self.abort_reason = reason
self.should_die = True self.should_die = True
def release_dhcp_clients(self, wiface, liface):
""" Release all running dhcp clients. """
wiface.ReleaseDHCP()
liface.ReleaseDHCP()
def stop_dhcp_clients(self, iface): def stop_dhcp_clients(self, iface):
""" Stop and running DHCP clients, as well as wpa_supplicant. """ """ Stop and running DHCP clients, as well as wpa_supplicant. """
print 'Stopping wpa_supplicant, and any dhcp clients' print 'Stopping wpa_supplicant, and any dhcp clients'
@@ -625,6 +630,7 @@ class WirelessConnectThread(ConnectThread):
# Dake down interface and clean up previous connections. # Dake down interface and clean up previous connections.
self.put_iface_down(wiface) self.put_iface_down(wiface)
self.abort_if_needed() self.abort_if_needed()
self.release_dhcp_clients(wiface, liface)
self.reset_ip_addresses(wiface, liface) self.reset_ip_addresses(wiface, liface)
self.stop_dhcp_clients(wiface) self.stop_dhcp_clients(wiface)
self.abort_if_needed() self.abort_if_needed()
@@ -862,6 +868,7 @@ class WiredConnectThread(ConnectThread):
# Take down interface and clean up previous connections. # Take down interface and clean up previous connections.
self.put_iface_down(liface) self.put_iface_down(liface)
self.release_dhcp_clients(wiface, liface)
self.reset_ip_addresses(wiface, liface) self.reset_ip_addresses(wiface, liface)
self.stop_dhcp_clients(wiface) self.stop_dhcp_clients(wiface)
self.abort_if_needed() self.abort_if_needed()

View File

@@ -86,5 +86,5 @@ connect at startup to any preferred network within range.
) )
print "Running post-install configuration..." print "Running post-install configuration..."
os.system("other/postinst") #os.system("other/postinst")
print 'Done.' print 'Done.'