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>
This commit is contained in:
parent
8019033fc5
commit
30885edb7e
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue