mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-17 17:43:06 -05:00
wpaspy: Do not leave socket files behind if connection fails
Ctrl::__init__ needs to handle socket.connect() exceptions and unlink the client socket file on failures. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
b44db5f6d6
commit
d52747c99e
@ -22,7 +22,12 @@ class Ctrl:
|
|||||||
self.local = "/tmp/wpa_ctrl_" + str(os.getpid()) + '-' + str(counter)
|
self.local = "/tmp/wpa_ctrl_" + str(os.getpid()) + '-' + str(counter)
|
||||||
counter += 1
|
counter += 1
|
||||||
self.s.bind(self.local)
|
self.s.bind(self.local)
|
||||||
self.s.connect(self.dest)
|
try:
|
||||||
|
self.s.connect(self.dest)
|
||||||
|
except Exception, e:
|
||||||
|
self.s.close()
|
||||||
|
os.unlink(self.local)
|
||||||
|
raise
|
||||||
self.started = True
|
self.started = True
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user