wpaspy: Be a bit more careful on detaching the control interface

Check that the client socket is still open before trying to detach the
control interface to avoid undesired exceptions on cleanup paths on
unexpected errors due to the socket getting closed.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
master
Jouni Malinen 4 years ago committed by Jouni Malinen
parent 8019033fc5
commit 30885edb7e

@ -113,6 +113,9 @@ class Ctrl:
def detach(self):
if not self.attached:
return None
if self.s.fileno() == -1:
self.attached = False
return None
while self.pending():
ev = self.recv()
res = self.request("DETACH")

Loading…
Cancel
Save