mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +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:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user